Flash Programming question on MC9S08AC16

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Flash Programming question on MC9S08AC16

1,158 Views
Spookydude
Contributor III

Hi, I am starting a new project using the MC9S08AC16.  I need to use the FLASH to store data that is occasionally updated.  I upgraded from using an MC68HC908JL8 which had Freescale ROM resident routines for handling flash since you could not program FLASH and execute from it at the same time.  This new chip does not seem to have the same limitation on the FLASH.  Is this True?  I cannot find anywhere in the reference manuals any mention of ROM resident routines or the inability to Program FLASH while executing from FLASH.  Can anyone verify this?  Thanks!

Labels (1)
0 Kudos
Reply
3 Replies

676 Views
peg
Senior Contributor IV

Hello,

 

You are not looking hard enough then.

most (all?) S08 do not have any resident flashing routines.

You cannot programme and execute from the same flash array.

This usually means running from RAM while flashing/erasing or running from the other array on some large memory devices.

There is literally 100's of posts here on this.

FLASH as EEPROM is a good search term.

https://community.freescale.com/message/35354#35354.

0 Kudos
Reply

676 Views
Spookydude
Contributor III

Well that sux!  the 908 was easy to work with, this S08 is making me jump through hoops and I have a tight deadline approaching.  No ROM resident programs and a reference manual that leaves a lot to be desired.  :-(    Thanks for the help!

0 Kudos
Reply

676 Views
bigmac
Specialist III

Hello,

 

You will notice that the datasheet does contain detailed flow diagrams for each of the flash operations.  However, only a portion of the code needs to execute from RAM, i.e. from when the flash command is activated by clearing the FCBEF bit, to when it completes, and the FCCF flag becomes set.  This is the period when the flash array will be inaccessible.

 

One of two methods may be used to handle the small amount of RAM-based code -

  1. Push the code onto the stack, and execute from there, or alternatively
  2. Transfer the code to a fixed block of RAM.

The attached code demonstrates the second method, which does also require some alteration to the PRM file for the project.

 

Regards,

Mac

 

0 Kudos
Reply