El programa funcionó, había hecho algunas conexiones de hardware incorrectas. Aquí está el código de trabajo:
// Program to use External (Hardware) Interrupts of AVR Microcontroller (ATmega16)
#include<avr/io.h>
#include<util/delay.h>
#include<avr/interrupt.h>
/***** Function To Initialize Ports*****/
void init_ports()
{
DDRA = 0xFF;
PORTA = 0x55;
}
/***** Function To Initialize Interrupts*****/
void init_interrupts()
{
cli(); //Disable Global Interrupts
GICR =(1<<INT0); //Set Bit6 of GICR to unmask INT0 interrupt.
MCUCR =(0<<ISC00); //Configuring MCUCR for Rising Edge interrupt for INT0
sei(); //Enable Global Interrupts
}
/***** Interrupt Service Routine For INT0*****/
ISR (INT0_vect)
{
PORTA=~PORTA;
OCR1A=OCR1A+1;
_delay_ms(100);
if(OCR1A==305)
{ OCR1A=65;
_delay_ms(200);
}
}
/***** Main Function *****/
int main(void)
{
//Configure TIMER1
TCCR1A|=(1<<COM1A1)|(1<<COM1B1)|(1<<WGM11); //NON Inverted PWM
TCCR1B|=(1<<WGM13)|(1<<WGM12)|(1<<CS11)|(1<<CS10); //PRESCALER=64 MODE 14(FAST PWM)
ICR1=2499; //fPWM=50Hz (Period = 20ms Standard).
DDRD|=(1<<PD4)|(1<<PD5); //PWM Pins as Out
OCR1A=65;
init_ports();
while(1)
{
init_interrupts();
}
}