Hi,
I used Atmega32(DIP) in my prototype board to test part of my source code, the execution is smooth. Then I ported the code to Atmega64, only little code modifications are required.
However, I found the program counter quickly goes to an unknown address when the program runs in the beginning. I then trace the program using the debugger and find the program retrieve a wrong program counter after calling subroute, which finally brings the program to reset. Why this happens? Could anyone help me? The code segment is attached in the following. Thanks!
int main(void) { unsigned char key,sc; unsigned char uc;
timerInit();
: :
timerAttach(TIMER0OVERFLOW_INT,&timer); initKB();
: : }
void timerInit(void) { u08 intNum; // detach all user functions from interrupts for(intNum=0; intNum