I'm looking at using an M16C/6N5 in a project involving CAN bus, and using CAN to re-flash products in the field could be _very_ handy. Does anybody have any experience using that feature?
I've seen several USB-serial widgets that can be used to burn M16C flash via serial port, but I haven't seen any mention of something like that for CAN...
--
Grant Edwards grante Yow! My haircut is totally
at traditional!
The M16C supports three modes to write to the flash. Paralell programming (that's really only available with a special programmer where you have to put the chip into it and hence totaly useless for your purpose), serial mode where - as you describe you can download firmware through the serial port and ala's where those USB modules can be used and also a self programming mode. The latter might save you if you are not after first time programming the device but if it's just for upgrading. You could write a little loader routine that reads the new firmware over the CAN bus and writes it into the flash. The 62P variants can do this even from within the flash, that said with them it's not even needed to copy the loader code into ram first. I do something very similar in my current project except that I use a periphal ethernet chip instead of CAN.
1) parallel (requires special adapter and programmer) 2) serial (sync or async -- uses built-in-bootloader mode) 3) CAN (uses built-in-bootloader mode) 4) CPU/software self-programming
I'm asking about using the CAN bootloader mode -- like serial bootloader mode except it reads data from the CAN interface instead of from the UART. Renesas sells a USB to serial widget for use with 2) but I can't find any hardware tools or specs for CAN bootloader mode. I've sent e-mail to the local FAE, but I was wondering if anybody in the real world had used that feature.
--
Grant Edwards grante Yow! By MEER biz doo
at SCHOIN...
If you have any technical questions related to the TASKING toolchain feel free to contact: snipped-for-privacy@altium.com
I guess it's time to go through the CAN specs or read a book... ;-)
To put things simple: CAN messages consist of up to 8 data bytes and some additional information like message length, ID and so forth. The Renesas Appnote explains that pretty well. (A TASKING port for the code written for Renesas NC 30 is available, just ask.)
You will have to implement a block transfer of 8 bytes each rather than a serial character stream of data in the flash routine.
I know how CAN works. What I don't know is what msg ID the bootloader is expecting, what data format it's expecting, etc.
What app note? I've spent _hours_ searching the Renesas web site and have come up with nothing.
I'm really confused now.
NC30? Tasking port? It sounds like you're talking about something written for the M16C. I want to know how to use the built-in bootloader. I don't want to write a bootloader.
I don't want to impliment anything on the M16C.
I want to know how to use the bootloader that's built in to the part.
--
Grant Edwards grante Yow! FUN is never having
at to say you're SUSHI!!
Grant, this is an appnote about using the CAN peripheral - not about a CAN flashloader. In conjunction with the flashloader example I mentioned you can create a flashloader via CAN.
You will have to do a little programming though...
regards /jan
Grant Edwards schrieb in im Newsbeitrag: snipped-for-privacy@isis.visi.com...
No problem. I could write a loader program if I cound find info on what format data the CAN bootloader expects to be sent. I can't find that info anywhere.
--
Grant Edwards grante Yow! Kids, don't gross me
at off... "Adventures with
The built in booloader of the M16C only allows programming via UART, -- not via CAN. (see Renesas FAQ, url below)
written
a
If you want to program the on-chip flash of the M16C via CAN you will have to write a flashloader program. There currently is no other way. An example as how to do this with the UART is available. If you want to program via CAN you will have to modify the I/O routines of the flash loader example from UART to CAN. The choice of the CAN message ID is up to you.
If you need the source code for the application note mentioned below, feel free to contact me.
Somehow the accompanying source code for the AppNote got lost when Renesas redesigned the website.
The Application note can be found at:
formatting link
202.pdf
and
formatting link
l
Please also visit the FAQ page:
formatting link
The flash starter software (executables and source code) can be found at:
formatting link
For flash programming via CAN there is no other way.
The source code of the flash starter software may reveal how it is done. To be honest I did not have a look inside.
"We are also preparing a TS-version boot program which will use CAN, serial, and UART modes. We plan to release the production version by Sept., 1999."
According to all of the documentation I can find, the bootloader will work with CAN. There is even a CAN programmer available that is supposed to work with the M16C/6N[45]:
formatting link
Are you sure? All of the M16C/6N[45] documentation I can find says that CAN flash programming is available. IMO, that was the one feature that gave teh M16C an advantage over the C16x and ST10 parts.
Thanks much for all the help. The M16C is looking less and less attractive the more I find out about it...
--
Grant Edwards grante Yow! Where's th' DAFFY
at DUCK EXHIBIT??
No tools available for Linux (commercial or free).
Poor documentation and Mitsubishi's bad reputation supporting small customers.
M16C's general reputation as being quirky and difficult to work with.
Lack of registers compared to most of the other parts I'm looking at. The architecture doesn't seem very modern. I suspect that lack of registers will adversely affect code density and throughput.
Fixed chip selects: the "near" address space is chopped up so that if you want to add more than 32K of external RAM, you have to add glue logic.
Plus:
Cheap. Low end part M16C/6N5 is about $10, but I'd have to add external RAM. Parts with more memory seem to be abou the same price as competing parts.
Low power -- abotu 18mA compared to 40mA or so for competing parts. However, if you add an external SRAM it'll draw 20-30mA.
CAN boot mode -- which may or may not work. If it does, I haven't been able to find any info on how to use it.
--
Grant Edwards grante Yow! Where's th' DAFFY
at DUCK EXHIBIT??
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.