Hi,
We use CAN for programming and internal data
aquisition of target processor. We have our own
hardware for PC interface(parallel port to CAN
interface using HCS12). Our software developed in VC++
(MFC application).
Refer Motorola application Note AN1828 "Flash
programming via CAN" it is good document to begin.
Regards,
Venu
--- Andreas Mueller <> wrote: > Hello Lenux,
>
> I have written a simple download procedure for
> downloading via RS232 (for DP256 CPU). It works
> fine, but I also wanted to download code via CAN. Is
> it possible that you send me a example how to do
> this?
> What Hardware, software do you use on PC- side ?
> Best regards
>
> Andy
>
> ----- Original Message -----
> From: lenux22
> To:
> Sent: Wednesday, September 17, 2003 11:18 AM
> Subject: [68HC12] Re: Flash/EEPROM Programming via
> CAN
> Hello, Trevor.
> To interface with HCS12 (i.e. load program to it)
> we use CAN-USB or
> CAN-COM module. Yes, we write PC program (in C) to
> communicate via USB
> or COM port with target (HCS12 device). All cables
> we made by
> ourselfs. Our standart cable is 4-pin (CAN HIGH,
> CAN LOW, VCC and GND)
> and connected to HCS12 to supply it with Vcc.
>
>
> WBR, lenux
>
> --- In , "Trevor Wigle"
> <trevorwigle@e...>
> wrote:
> > Hi Lenux,
>
> > Thank you for you informative response and
> generously posting your
> code.
>
> > I was curious what you did for the host (i.e.,
> non-HC12) side of
> things.
> > Did you write a PC program to communicate with
> your bootrom? If so,
> for
> > what language (Visual Basic, some scripting
> language, etc.)? How
> did you
> > interface your target HC12 to your PC (or
> whatever contains the
> "new" code)?
> > Did you use any specific cables, like Vector's
> CANcardX (or make a
> "smart"
> > cable mentioned in the app note)? Can you make
> any recommendations?
>
> > Thanks,
> > - Andrew
>
> > -----Original Message-----
> > From: lenux22 [mailto:lenux22@y...]
> > Sent: Thursday, September 11, 2003 3:22 AM
> > To:
> > Subject: [68HC12] Re: Flash/EEPROM Programming
> via CAN
>
>
> > Hi Trevor,
>
>
> > Yes, we made our own bootrom, which let us
> download program to FLASH
> > by CAN. Our bootrom have size 2K and placed at
> 0xF000 address of
> > HCS12 DG128 microcontroller. Boot procces
> consist of this parts:
>
>
> > 1. Host (PC or CAN-master) send 4 messages with
> specific ID. This
> > messages contains unique (4 double words)
> address of module.
> (Address
> > writed in protected area of bootrom and can not
> be rewrited)
>
>
> > 2. If module received its address it start
> receive other messages
> that
> > hold RAM-data. This way let us load any program
> to RAM. At then end
> > we send message this 'jump to RAM' command.
>
>
> > 3. RAM program had all needed Flash/EEPROM
> routines
> > (PROGRAM/ERASE/READ). For example host can send
> 'flash erase'
> >
> === message truncated ===
__________________________________
Reply by Andreas Mueller●September 17, 20032003-09-17
Hello Lenux,
I have written a simple download procedure for downloading via RS232 (for DP256
CPU). It works fine, but I also wanted to download code via CAN. Is it possible
that you send me a example how to do this?
What Hardware, software do you use on PC- side ?
Best regards
Andy
----- Original Message -----
From: lenux22
To:
Sent: Wednesday, September 17, 2003 11:18 AM
Subject: [68HC12] Re: Flash/EEPROM Programming via CAN
Hello, Trevor.
To interface with HCS12 (i.e. load program to it) we use CAN-USB or
CAN-COM module. Yes, we write PC program (in C) to communicate via USB
or COM port with target (HCS12 device). All cables we made by
ourselfs. Our standart cable is 4-pin (CAN HIGH, CAN LOW, VCC and GND)
and connected to HCS12 to supply it with Vcc.
WBR, lenux
--- In , "Trevor Wigle" <trevorwigle@e...>
wrote:
> Hi Lenux,
>
> Thank you for you informative response and
generously posting your code.
>
> I was curious what you did for the host (i.e.,
non-HC12) side of things.
> Did you write a PC program to communicate with
your bootrom? If so, for
> what language (Visual Basic, some scripting
language, etc.)? How did you
> interface your target HC12 to your PC (or whatever
contains the "new" code)?
> Did you use any specific cables, like
Vector's CANcardX (or make a "smart"
> cable mentioned in the app note)? Can you make any
recommendations?
>
> Thanks,
> - Andrew
>
> -----Original Message-----
> From: lenux22 [mailto:lenux22@y...]
> Sent: Thursday, September 11, 2003 3:22 AM
> To:
> Subject: [68HC12] Re: Flash/EEPROM Programming via
CAN
>
>
> Hi Trevor,
>
>
> Yes, we made our own bootrom, which let us
download program to FLASH
> by CAN. Our bootrom have size 2K and placed at
0xF000 address of
> HCS12 DG128 microcontroller. Boot procces consist
of this parts:
>
>
> 1. Host (PC or CAN-master) send 4 messages with
specific ID. This
> messages contains unique (4 double words) address
of module. (Address
> writed in protected area of bootrom and can not be
rewrited)
>
>
> 2. If module received its address it start receive
other messages that
> hold RAM-data. This way let us load any program to
RAM. At then end
> we send message this 'jump to RAM'
command.
>
>
> 3. RAM program had all needed Flash/EEPROM
routines
> (PROGRAM/ERASE/READ). For example host can send
'flash erase'
>
>
> command or 'load flash' command.
>
>
> 4. Then host done flash programming it's send
'reset command'. After
> this module reboots (by watchdog) and starts again
from bootrom. After
> 0.3 sec passed, if no messages with address of
modules comes, module
> jumped from bootrom to main program in Flash.
>
>
>
>
> All code (for bootrom and RAM program) writed in
C. (assemler used
> only for 'jump to address' routine). All
works fine. It is simple to
> write this programs (I have spend two weeks). If
you want, I can send
> sources.
Hello, Trevor.
To interface with HCS12 (i.e. load program to it) we use CAN-USB or
CAN-COM module. Yes, we write PC program (in C) to communicate via USB
or COM port with target (HCS12 device). All cables we made by
ourselfs. Our standart cable is 4-pin (CAN HIGH, CAN LOW, VCC and GND)
and connected to HCS12 to supply it with Vcc.
WBR, lenux
--- In , "Trevor Wigle" <trevorwigle@e...>
wrote:
> Hi Lenux,
>
> Thank you for you informative response and
generously posting your code.
>
> I was curious what you did for the host (i.e.,
non-HC12) side of things.
> Did you write a PC program to communicate with
your bootrom? If so, for
> what language (Visual Basic, some scripting
language, etc.)? How did you
> interface your target HC12 to your PC (or whatever
contains the "new" code)?
> Did you use any specific cables, like
Vector's CANcardX (or make a "smart"
> cable mentioned in the app note)? Can you make any
recommendations?
>
> Thanks,
> - Andrew
>
> -----Original Message-----
> From: lenux22 [mailto:lenux22@y...]
> Sent: Thursday, September 11, 2003 3:22 AM
> To:
> Subject: [68HC12] Re: Flash/EEPROM Programming via
CAN
>
>
> Hi Trevor,
>
>
> Yes, we made our own bootrom, which let us
download program to FLASH
> by CAN. Our bootrom have size 2K and placed at
0xF000 address of
> HCS12 DG128 microcontroller. Boot procces consist
of this parts:
>
>
> 1. Host (PC or CAN-master) send 4 messages with
specific ID. This
> messages contains unique (4 double words) address
of module. (Address
> writed in protected area of bootrom and can not be
rewrited)
>
>
> 2. If module received its address it start receive
other messages that
> hold RAM-data. This way let us load any program to
RAM. At then end
> we send message this 'jump to RAM'
command.
>
>
> 3. RAM program had all needed Flash/EEPROM
routines
> (PROGRAM/ERASE/READ). For example host can send
'flash erase'
>
>
> command or 'load flash' command.
>
>
> 4. Then host done flash programming it's send
'reset command'. After
> this module reboots (by watchdog) and starts again
from bootrom. After
> 0.3 sec passed, if no messages with address of
modules comes, module
> jumped from bootrom to main program in Flash.
>
>
>
>
> All code (for bootrom and RAM program) writed in
C. (assemler used
> only for 'jump to address' routine). All
works fine. It is simple to
> write this programs (I have spend two weeks). If
you want, I can send
> sources.
Reply by Trevor Wigle●September 15, 20032003-09-15
Hi Lenux,
Thank you for you informative response and generously posting your code.
I was curious what you did for the host (i.e., non-HC12) side of things.
Did you write a PC program to communicate with your bootrom? If so, for
what language (Visual Basic, some scripting language, etc.)? How did you
interface your target HC12 to your PC (or whatever contains the "new"
code)?
Did you use any specific cables, like Vector's CANcardX (or make a
"smart"
cable mentioned in the app note)? Can you make any recommendations?
Thanks,
- Andrew
-----Original Message-----
From: lenux22 [mailto:]
Sent: Thursday, September 11, 2003 3:22 AM
To:
Subject: [68HC12] Re: Flash/EEPROM Programming via CAN
Hi Trevor,
Yes, we made our own bootrom, which let us download program to FLASH
by CAN. Our bootrom have size 2K and placed at 0xF000 address of
HCS12 DG128 microcontroller. Boot procces consist of this parts:
1. Host (PC or CAN-master) send 4 messages with specific ID. This
messages contains unique (4 double words) address of module. (Address
writed in protected area of bootrom and can not be rewrited)
2. If module received its address it start receive other messages that
hold RAM-data. This way let us load any program to RAM. At then end
we send message this 'jump to RAM' command.
3. RAM program had all needed Flash/EEPROM routines
(PROGRAM/ERASE/READ). For example host can send 'flash erase'
command or 'load flash' command.
4. Then host done flash programming it's send 'reset command'.
After
this module reboots (by watchdog) and starts again from bootrom. After
0.3 sec passed, if no messages with address of modules comes, module
jumped from bootrom to main program in Flash.
All code (for bootrom and RAM program) writed in C. (assemler used
only for 'jump to address' routine). All works fine. It is simple
to
write this programs (I have spend two weeks). If you want, I can send
sources.
WBR, lenux
--- In , "Yogeesh" <yogeesh@c...> wrote:
> I would also like to have a copy of the code.
>
> Cheers,
> Yogeesh
>
>
> > ----- Original Message -----
> > From: "Alexander Veit"
<alex.veit@t...>
> > To: <>
> > Sent: Friday, September 12, 2003 5:18 AM
> > Subject: [68HC12] Re: Flash/EEPROM
Programming via CAN
> >
> >
> > > UPS!
> > >
> > > To fast!*g*
> > >
> > > Thanks for sharing!!
> > >
> > > Alex
Reply by Yogeesh●September 13, 20032003-09-13
I would also like to have a copy of the code.
Cheers,
Yogeesh
> ----- Original Message -----
> From: "Alexander Veit" <alex.veit@t...>
> To: <>
> Sent: Friday, September 12, 2003 5:18 AM
> Subject: [68HC12] Re: Flash/EEPROM Programming via CAN
> > UPS!
> >
> > To fast!*g*
> >
> > Thanks for sharing!!
> >
> > Alex
Reply by kqzca●September 12, 20032003-09-12
I would also like to have a copy of the code.
Thanks.
Kevin
> ----- Original Message -----
> From: "Alexander Veit" <alex.veit@t...>
> To: <>
> Sent: Friday, September 12, 2003 5:18 AM
> Subject: [68HC12] Re: Flash/EEPROM Programming via CAN
> > UPS!
> >
> > To fast!*g*
> >
> > Thanks for sharing!!
> >
> > Alex
Reply by Steve Letkeman●September 12, 20032003-09-12
I hate to post a "me too" but I would also like a
copy of this code, if possible. Thanks!
Steve
Automated lighting systems at www.brightan.com
Embedded micro-controllers and CAN interfaces at www.zanthic.com
----- Original Message -----
From: "Alexander Veit" <>
To: <>
Sent: Friday, September 12, 2003 5:18 AM
Subject: [68HC12] Re: Flash/EEPROM Programming via CAN
> UPS!
>
> To fast!*g*
>
> Thanks for sharing!!
>
> Alex
> --- In , "Alexander Veit" <alex.veit@t...>
> wrote:
> > That sounds easier than my experience told me till now.
> >
> > My main problem is not to change the Protocol to some other (I will
> > implement a Bootloader via K-Line Protocol). I still can not port
> the
> > Bootloader-samplecode (written in Assembler) from Motorola to C.
> >
> > So it would be realy great if i could get source from you to
> > understand how the bootloader works and how it could be implemented
> > in C.
> >
> > If someone will be interested in Bootloading via K-Line i will also
> > give Sourcecode ( After i got it working *g*)
> >
> > Alex
> >
> > --- In , "lenux22" <lenux22@y...> wrote:
> > > Hi Trevor,
> > >
> > >
> > > Yes, we made our own bootrom, which let us download program to
> > FLASH
> > > by CAN. Our bootrom have size 2K and placed at 0xF000 address
of
> > > HCS12 DG128 microcontroller. Boot procces consist of this
parts:
> > >
> > >
> > > 1. Host (PC or CAN-master) send 4 messages with specific ID.
This
> > > messages contains unique (4 double words) address of module.
> > (Address
> > > writed in protected area of bootrom and can not be rewrited)
> > >
> > >
> > > 2. If module received its address it start receive other
messages
> > that
> > > hold RAM-data. This way let us load any program to RAM. At
then
> > end
> > > we send message this 'jump to RAM' command.
> > >
> > >
> > > 3. RAM program had all needed Flash/EEPROM routines
> > > (PROGRAM/ERASE/READ). For example host can send 'flash
erase'
> > >
> > >
> > > command or 'load flash' command.
> > >
> > >
> > > 4. Then host done flash programming it's send 'reset
command'.
> > After
> > > this module reboots (by watchdog) and starts again from
bootrom.
> > After
> > > 0.3 sec passed, if no messages with address of modules comes,
> > module
> > > jumped from bootrom to main program in Flash.
> > >
> > >
> > >
> > >
> > > All code (for bootrom and RAM program) writed in C. (assemler
> used
> > > only for 'jump to address' routine). All works fine. It
is simple
> > to
> > > write this programs (I have spend two weeks). If you want, I
can
> > send
> > > sources.
> > >
> > >
> > >
> > >
> > > WBR, lenux
>
> --------------------
>
> ">http://docs.yahoo.com/info/terms/
>
Reply by Alexander Veit●September 12, 20032003-09-12
UPS!
To fast!*g*
Thanks for sharing!!
Alex
--- In , "Alexander Veit" <alex.veit@t...>
wrote: > That sounds easier than my experience told me till
now.
>
> My main problem is not to change the Protocol to some other (I will
> implement a Bootloader via K-Line Protocol). I still can not port the > Bootloader-samplecode (written in Assembler) from
Motorola to C.
>
> So it would be realy great if i could get source from you to
> understand how the bootloader works and how it could be implemented
> in C.
>
> If someone will be interested in Bootloading via K-Line i will also
> give Sourcecode ( After i got it working *g*)
>
> Alex
>
> --- In , "lenux22" <lenux22@y...> wrote:
> > Hi Trevor,
> >
> >
> > Yes, we made our own bootrom, which let us download program to
> FLASH
> > by CAN. Our bootrom have size 2K and placed at 0xF000 address of
> > HCS12 DG128 microcontroller. Boot procces consist of this parts:
> >
> >
> > 1. Host (PC or CAN-master) send 4 messages with specific ID. This
> > messages contains unique (4 double words) address of module.
> (Address
> > writed in protected area of bootrom and can not be rewrited)
> >
> >
> > 2. If module received its address it start receive other messages
> that
> > hold RAM-data. This way let us load any program to RAM. At then
> end
> > we send message this 'jump to RAM' command.
> >
> >
> > 3. RAM program had all needed Flash/EEPROM routines
> > (PROGRAM/ERASE/READ). For example host can send 'flash
erase'
> >
> >
> > command or 'load flash' command.
> >
> >
> > 4. Then host done flash programming it's send 'reset
command'.
> After
> > this module reboots (by watchdog) and starts again from bootrom.
> After
> > 0.3 sec passed, if no messages with address of modules comes,
> module
> > jumped from bootrom to main program in Flash.
> >
> >
> >
> >
> > All code (for bootrom and RAM program) writed in C. (assemler used > > only for 'jump to address'
routine). All works fine. It is simple
> to
> > write this programs (I have spend two weeks). If you want, I can
> send
> > sources.
> >
> >
> >
> >
> > WBR, lenux
Reply by Alexander Veit●September 12, 20032003-09-12
That sounds easier than my experience told me till now.
My main problem is not to change the Protocol to some other (I will
implement a Bootloader via K-Line Protocol). I still can not port the
Bootloader-samplecode (written in Assembler) from Motorola to C.
So it would be realy great if i could get source from you to
understand how the bootloader works and how it could be implemented
in C.
If someone will be interested in Bootloading via K-Line i will also
give Sourcecode ( After i got it working *g*)
Alex
--- In , "lenux22" <lenux22@y...> wrote: > Hi Trevor,
> Yes, we made our own bootrom, which let us download program to FLASH > by CAN. Our bootrom have size 2K and placed at
0xF000 address of
> HCS12 DG128 microcontroller. Boot procces consist of this parts:
> 1. Host (PC or CAN-master) send 4 messages with specific ID. This
> messages contains unique (4 double words) address of module. (Address > writed in protected area of bootrom and can not be
rewrited)
> 2. If module received its address it start receive other messages that > hold RAM-data. This way let us load any program to
RAM. At then end > we send message this 'jump to RAM'
command.
> 3. RAM program had all needed Flash/EEPROM routines
> (PROGRAM/ERASE/READ). For example host can send 'flash erase'
> command or 'load flash' command.
> 4. Then host done flash programming it's send 'reset
command'. After > this module reboots (by watchdog) and starts again
from bootrom. After > 0.3 sec passed, if no messages with address of
modules comes, module > jumped from bootrom to main program in Flash.
>
>
> All code (for bootrom and RAM program) writed in C. (assemler used
> only for 'jump to address' routine). All works fine. It is simple
to > write this programs (I have spend two weeks). If
you want, I can send > sources.
>
>
> WBR, lenux