baileychic
Advanced Member level 3
How to get exact 1 ms Timer0 OVF Interrupt for ATMega8A ?
This is my code. I am not getting exact 1 ms interrupt. My OSC is 4 MHz Internal RC Oscillator. Fuses are correct.
This is my code. I am not getting exact 1 ms interrupt. My OSC is 4 MHz Internal RC Oscillator. Fuses are correct.
Code:
void InitTimer0() {
TCCR0 = 0x02;
SREG_I_bit = 1;
TOIE0_bit = 1;
}
void Timer0Overflow_ISR() org IVT_ADDR_TIMER0_OVF {
TCNT0 = 0x06;
}