Rob Guyatt

QY4A Flash as EEPROM COP Bug

Discussion created by Rob Guyatt on Jun 7, 2006
Latest reply on May 30, 2007 by xcrow81 xcrow81
I have an application which I'm trying to convert from using an m93c46 eeprom chip for a few bytes of data to using flash as eeprom. No probs with writing the data to flash. The problem is if the flash as ee is used COP reset is a problem.
On startup, the software detects a freshly programmed mcu (or blank m93' when operated that way) and writes a set of default values into flash (or m93'). After that, the software enters the main loop. If the flash as eeprom method is used, the mcu resets due to COP timeout once it enters the main loop. The mcu continues to COP reset even though the flash writing code is not touched on second and subsequent resets.
Cop timeout period is long and main loop is 2.5 ms. COP is serviced at the top of the main loop.
In the main loop, the software monitors supply voltage. If too high, software stays in a loop reading the adc till the voltage returns below limit. That adc loop also services COP. If I wind up the voltage to above the limit to get the program to stay in the adc loop the mcu does not COP reset while in that holding loop. When supply is returned to below limit and program returns to the main loop the COP ceases to timeout. Figure that out! PLEASE!!
The only difference in the software between using external storage and flash as storage is in the initialisation section and there's nothing changed in the main loop (or the adc loop).
Unfortunately I can't use a debugger when operating in the mcu as all I/O are spoken for. I have an MMEVS but that's no use in this case as you can't use flash as eeprom method there.
Sorry for the long winded description but this has me stumped.