Shousha
Shousha
DIIDevHeads IoT Integration Server
Created by Shousha on 7/30/2024 in #firmware-and-baremetal
Why is my ATmega32 timer interrupt not executing?
#include<avr/io.h> #include<util/delay.h> #include<avr/interrupt.h> #define F_CPU 1000000UL int main(void){ SREG=1<<7;//enable the I-bit DDRC=0x01;//output PORTC=0x00;//initializing not depending on default values in the datasheet TCCR0=0x01; TIMSK=0x01;//enabling the interrupt of overflow and compare TCNT0=0x00; for(;;){ } } ISR(TIMER0_OVF_vect){ PORTC^=0x01; }
35 replies