Hello John,
Are you erasing the flash page before trying to re-program the byte value?
Regards,
Mac
Hi Mac,
Actually, I execute this code after I use my P&E Micro Multilink 12 to program the flash. As far as I understand, it completely erases the flash. All of the cells are filled with "ff".
I actually wrote a small piece of code (that I executed before the code shown above) to erase a 512 byte portion of the flash prior to programming it. It did not make any difference.
Best Regards,
John
Hi Glork,
Thanks for the suggestions. I will give them a try. The way I placed my code in RAM was to simply put it below the RAM variables (i.e org RAMStart). The routine would only function while my board was powered up. If I turned it off, the routine would disappear. I am just trying to get the basic functionality going.
You made a comment about destroying the flash with the wrong timing. Could you comment on that further? I may have already destroyed the flash.
John
Hi Glork,
Petr from Freescale sent me a small piece of code that worked perfectly. The error I had in my code was the following - I used $4b in the FCDIV variable instead of $4c. I used $4b because the HCS08 Family Reference Manual Revision 1 (pg. 84) recommended using the following for a 32.768kHz crystal:
initFCDIV equ %01001011 (i.e. 4b)
The code I received from Freescale had $4c loaded into the FCDIV. I sent a message to Freescale asking them to look into this.
Thanks for you comments,
John G.