Problems with HCS12

Hello everyone!

I am using the S12compact Module

formatting link
with a MC9S12DG256 MCU. Loading my first small programs into the internal RAM via D-Bug4 worked fine. Problems occurred while loading them into EEPROM or Flash Memory. The Linker settings of the ICC12 Compiler were correct, but when I tried to upload the s12-files with D-Bug in EVB-Mode and the LOAD-command I got either a checksum error (storing in EEPROM) or a message "Can't write target memory" (storing in Flash). I don't have a special cable for the BDM and I don't know how to get to this mode with D-Bug. Please help me to solve the problems. Also I would be very happy I you can give me a link to a good Tutorial.

Thanks in advance!

Jan

Reply to
Jan Kueting
Loading thread data ...

I don't know if d-bug4 is like d-bug12, but you can't write to flash with d-bug12 unless you use the pod mode (one device controlling the other in BDM mode), or you can overwrite the monitor using the bootloader (not recommended for a newbie).

This board is not one I'm familiar with, but you can check the "intro" link at my web site:

formatting link

Reply to
Eric

Thanks for your answer. Of course, it's D-Bug12 Version 4. It was a typo. That means I have to use the Bootloader Mode to write to the flash. But still I don't understand why I get a "Checksum Error" while writing to EEPROM at $0400. Must I also use the POD or Bootloader Mode?

Jan

Reply to
Jan Kueting

EEPROM has to be written slowly. I suggest dropping the baud rate down to 300 first. Give it the "baud 300" command, and then switch the rate on your program to 300.

If you continue to have trouble you can make a little memcopy routine that has a delay between bytes. Download this to RAM along with your code and execute it to populate EEPROM.

I generally don't like EEPROM for storing programs...

Reply to
Eric

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.