programming MC9S12DP256

Started by rod irineo November 1, 2006
I am having a hard time programming the MC9S12DP256. I am Using EmbeddedGNU 0.93 as my software. I have this guide on how to program the said microcontroller. It is said that I should be on mode 4 (bootloader) then I should reset the button. I followed this instructions. I followed that I should choose a then b, the bootloader will wait for my file. (do this really takes a long time???). When I saw that there was nothing happening, I proceed to the next instruction and clicked the Build button. It is also said in the instruction that I should be selecting the Download option and select the file Ep9S12_mon.s.19 located in the folder named "document" for downloading but in my case again, I have not done this step because it automatically download the code. then another problem occured. " S-Record Code/Data Length is Odd "- what does this mean? Is there a converter of data from odd to even? If its not the problem, "failure writing to flash" was another one I encountered. The
program I was using here was the example programs that can be seen in the EmbeddedGNU 0.93 folder. Will someone help me here.... I am just starting to learn this thing.

---------------------------------
Cheap Talk? Check out Yahoo! Messenger's low PC-to-Phone call rates.
--- In 6..., rod irineo wrote:
> I am having a hard time programming the MC9S12DP256. I am Using
> EmbeddedGNU 0.93 as my software. I have this guide on how to program
> the said microcontroller.

You did not mention, but I will assume you have some board that is
preloaded with D-Bug12 which has jumpers on PAD0/PAD1 to select
bootload mode...
> It is said that I should be on mode 4 (bootloader) then I should
> reset the button. I followed this instructions. I followed that I
> should choose a then b, the bootloader will wait for my file. (do
> this really takes a long time???). When I saw that there was nothing
> happening, I proceed to the next instruction and clicked the Build
> button.

What were you waiting for after pressing reset? The prompt asking you
to choose 'a' or 'b' means that it is waiting for you. When it is
waiting for you, don't wait for it to wait for you :)
> It is also said in the instruction that I should be selecting the
> Download option and select the file Ep9S12_mon.s.19 located in the
> folder named "document" for downloading but in my case again, I have
> not done this step because it automatically download the code. then
> another problem occured. " S-Record Code/Data Length is Odd "- what
> does this mean? Is there a converter of data from odd to even? If
> its not the problem, "failure writing to flash" was another one I
> encountered.

Perhaps the only problem is your odd length. The S12 must write flash
two bytes at a time. If one S record has 5 bytes, then the odd byte
will not be possible to write because it doesn't know the other byte
to write along with it.

The linker script in GCC should use ". = ALIGN(2);" in certain places
to ensure even alignment. If not (or for other purposes), SRecCvt.exe
can fix this fairly easy:
sreccvt -m c0000 fffff 32 -o FixedOut.S19 OddIn.S19