I have a C program which has a line of code as follows:
*pEBIU_AMBCTL = 0x0000F8C2;
The intention is to reduce the read access time on the internal flash memory. This works fine on the emulator and you can observe that the change in access time has a measureable effect on execution times. However, once it is programmed into the flash and the emulator disconnected, the program does not run. My hardware is configured to boot from flash.
I can change the code to
*pEBIU_AMBCTL = 0x0000FFC2;
which is the same as the reset value for this register. The end result is the same - it runs on emulator but not on the hardware alone.
If I remove this line of code, my program runs as expected, so it seems that accessing the EBIU in this way causes a problem. On reading the hardware manual for the 506F, it states that this register should not be programmed while the AMC is in use.
So, is there any way to change the access time, since the flash is immediately active on booting?