EmbeddedRelated.com
Forums

Problems with HCS12

Started by Jan Kueting October 7, 2005
Hello everyone!

I am using the S12compact Module (http://elmicro.com/en/s12compact.php)
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

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:
http://www.ericengler.com/AsmIDE.aspx

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

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...