Hello All,
I'm having a hard time struggling with a reset of my application. The Atmega644 is used for an RFID application and handles communication + protocol and all RFID operations including an anticollision scheme. The anticollision is implemented via recursive call's.
The application is written in CodeVisionAVR C compiler vers. 1.25.2.
I'm debugging in AVRstudio vers. 4.12 build 460 using JTAG mkII ICE.
The problem is an uncontrolled reset of the ATmega644. The reset always occurs when I loads the anticollision to a maximum by makeing the RFID reader handle way to many tags in the read area.
Now the mysterious part is:
- I have removed all Watchdog enabling/resetting to eliminate the possibility of a watchdog reset. I have verified that the watchdog registers are not written during execution.
- I have disabled the "Brown-out enable" fuse.
- I verified that the application not by accident jumps to the undefined part of the program memory and just runs until it returns to 0x0000 (Reset Vector). Further more all volatile memory is cleared when the problem occurs - stating that my problem is a reset for sure!
- I have made a "Reset Source checking" testing on the first five bits of the MCUSR register which descripes the cause of the last reset. I'm breakning the program execution at 0x0000 so I can check this register first thing after a reset. But when my problem occurs the register setting is always
A possibility could be a stack overflow caused by the recursivity - but that should not generate a uC reset?
I have tried getting closer to the bug using EEprom debug variables and so, but the antocollision algorithm is very timing strict which just made this aproach corrupting the application.
Any ideas on how I'll be getting closer to solve this anoying bug? Or anyone have an idea why I see this problem?
Best Regards
-- Morten M. J. Ba.Sci.EE
(this is also posted on avrfreaks.net)