I have timer0 set to overflow and generate an interrupt, but for whatever reason AVR Studio doesnt seem to be doing what the ISR is supposed to be doing! I'm attaching the code here, can you find something that I'm missing!?
Is this a problem with the simulation in AVR Studio or with the code itself? I haven't tested it on a device yet.
#include #include
ISR(TIMER0_COMP_vect) {
PORTA = 0xAA; TCNT0 = 0x00;
}void init_timer(void) {
sei();
TCCR0 = 0x0D; // Force Output Compare Off - CTC mode - OC0 disconnected TCNT0 = 0x00; OCR0 = 0xA0; // Overflow at 0xA0; TIMSK = TIMSK | 0x02 ; // Generate interrupt on Overflow
TIFR&=~(1