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?
hello I am beginning interfacing on the atmega32 and I am getting started with the peripherals and now I am stuck with the timers, this code isnt executing the interrupt code for some reason #include<avr/io.h> #include<util/delay.h> #include<avr/interrupt.h> 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=0x05;//setting the value of the prescaler TIMSK=0x03;//enabling the interrupt of overflow and compare for(;;){ } } ISR(TIMER0_OVF_vect){ PORTC^=0x01; }
35 replies