Hi,
I'm using MC9S08AW60, trying to use emulated EEPROM, but i'm wondering when programming or erasing flash memory, can the code be executed at the same time?
I found in AN3822 says:
"The MC9S08LG32/16 is a Freescale 8-bit microcontroller that contains two flash arrays. Program and erase operations can be conducted on one array while executing code from the other."
Does it mean if only one flash array exists, program and executing code can't be at the same time?
And can anyone tell me how many flash arrays is there in AW60?
Thanks!!
Solved! Go to Solution.
Hi Kef,
Thanks for your reply!
So, is there another flash array in AW60? I can't find any description about it in the datasheet.
And how to "Stay in RAM"?
Is it the case that after lauch command through FCBEF, the processor just hang up there and resume to execute after command completion?
Thanks!
Processor hangs because it can't read code memory. "Stay in RAM" means execute code from RAM. CPU program counter always should point to readable memory. And flash is not readable while flash command is in progress.
Don't know how many flash arrays AW60 has. It is simplier to use small portion of RAM to hold small routine that writes one to FCBEF flag and waits until FCCF. It is the same for all (or almost all) FSL MCUs and doesn't depend on how many arrays etc.
Hi Kef,
Is it necessary to place code into RAM? I mean if not, just let the processor hang at the place of launch flash command, after the command completed and flash is readable again, the processor will continue to execute.
If we put code into RAM, flash operation just run as a background command, but we can't jump anywhere else or service interrupts, am i right?
So usually what should we do in this code? Just wait FCCF to be set or do something else like feeding watchdog?
Thanks!
Hello,
Yes you need to place some code in ram which will also actually DO the programming and wait. Then it would normally jump back into flash and continue.
You cannot just let it hang and then recover!
Hi Peg,
Would you explain why can't we let it hang and recover? What will happen if we do that way?
Thanks!
Hi Kef,
Thanks for your infomation, it's helpful!
Regards,