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 -
- Push the code onto the stack, and execute from there, or alternatively
- 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