Hey there,
I'm doing a project at Uni which involves coding a MC9S12C64 ic . I'm very new to the world of coding & I'm just needing some help on loading firmware onto the MC9S12C64.
I have bought the chip from Farnell brand new so I'm assuming it has no bootloader loaded on, which is probably why I cant load any firmware onto it via serial.
I have done alot of reading & what I have garthered so far is that you can use the bdm way to upload the bootloader or the serial rs-232 way via the LREA (load ram and execute). I really want to do it the serial way because I dont have the bdm hardware. I have a few questions here...
I have noticed my chip isnt listed in the AN2546.pdf so will the LRAE load into my chip if I do it this way?
If I can load the LRAE into my chip via serial, could someone give me a step by step method into how to do this please? (include hardware mods, programs to use etc).
If I cant load the LRAE into my chip via serial, is there any other way of getting a bootlader into my chip via the serial connection?
Programes & notes I have already downloaded which may help are...
Code Warrior IDE V5 special
AN2548SW1.zip
AN2548SW2.zip
Thanks for any help/suggestions in advance.
Regards
Vijay N
The S12 is a modern MCU and therefore uses flash memory and BDM. You will not need a bootloader unless you have very special application requirements, like "re-flashing the CPU over an internet application" or some other crazyness.
RS-232 bootloaders are complex, slow and error-prone. BDM is fast, reliable, debug-friendly and production friendly. So for the average application you don't want a bootloader... its like trying to get an old T-Ford to work even though someone is offering you a Porsche for $100.
You can get a good, affordable BDM pod from PE Micro or Softec:
If you have more spare time than money, there is also some hobbist open-source BDM available called TBDML, somewhere on the web.
Ah I see,
My project that I have built & designed does not incorparated any BDM pins as I had no idea that it would need a bootloader which is my mistake, thats why I really want to do the serial way.
I'm wanting to flash the chip with the latest MegaSquirt II firmware (aftermarket ecu firmware) but I need to load the bootloader/serial monitor first.
Is it possible if anyone could tell me the pins that are used during the bdm proccess on a MC9S12C64 chip please? Maybe I can modify my board so that it accepts the 6 pin bdm. Is it just the BDKG & RESET pins?
Il do some reading on the TBDML you suggested too.
thanks
LRAE bootloader is not flashed to any chip at factory. Application note mentioned plans to flash LRAE at factory. AFAIK such plans were abandoned.
Yes, you should wire BKGD, RESET\ to 6pin header. Of course you need also GND. You should also wire VCC, because some BDM adapters are using this to determine target voltage and provide proper logics level shifting between BDM and target.
There is a forum for the open-source BDM cable and software on these forums. The forum for the HCS12 version is here:
http://forums.freescale.com/t5/TBDML-Turbo-BDM-Light-for-S12-X/bd-p/TBDML
Hope this helps.
---Tom
Thank you Tom, Kef and Lundin.
So the 6 pin header I have to make for my board will need the BDKG, RESET, GND & 5V, the other two are floating right? Il have a look for the arrangment of the 6 pins on the net, I'm sure il find something.
The infomation you guys have provided will help me to make/buy a bdm tool & will also help me to modify my board to accept the bdm.
Best Regards
Vijay N