vikrant
Junior Member level 2
hi all,
I am using ATmega1280 microcontroller with a external crystal of 7.3728 Mhz . IDE which I am using is AVR and WinAVR compiler.
I have written a timer ISR for timer1(16-bit), this timer I am using in CTC mode (Clear Timer on Compare Mode).
Initial settings are:
TCCR1A = 0x02; // for CTCmode;
TCCR1B = 0x04; // for Prescale 256;
TCNT1 = 0x00;
OCR1A = (7372800/256); // for One Second tick
TIMSK1 = 0x02; //for Interrupt On CompareA
Timer ISR:
SIGNAL(TIMER1_COMPA_vect){
//some code, say LED blink
}
but i am not getting 1 sec tick . Instead of that ISR is occuring very fast ,i guess it is in milli sec.
so any body tell me where is the problem.
I am using ATmega1280 microcontroller with a external crystal of 7.3728 Mhz . IDE which I am using is AVR and WinAVR compiler.
I have written a timer ISR for timer1(16-bit), this timer I am using in CTC mode (Clear Timer on Compare Mode).
Initial settings are:
TCCR1A = 0x02; // for CTCmode;
TCCR1B = 0x04; // for Prescale 256;
TCNT1 = 0x00;
OCR1A = (7372800/256); // for One Second tick
TIMSK1 = 0x02; //for Interrupt On CompareA
Timer ISR:
SIGNAL(TIMER1_COMPA_vect){
//some code, say LED blink
}
but i am not getting 1 sec tick . Instead of that ISR is occuring very fast ,i guess it is in milli sec.
so any body tell me where is the problem.