Monday, 26 October 2015

External Interrupt programming(INT0) of ATMEGA32

#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>

ISR(INT0_vect){
PORTA=0XFF;
_delay_ms(500);
PORTA=0X00;
_delay_ms(500);
}

int main(void)
{
//DDRD=0x00;
DDRA=0XFF;

MCUCR=0X02;
//MCUCSR=0X00;

GICR=0X40;

SREG=0X80;

TCCR0=0x05;

while(1);
}    

No comments:

Post a Comment