i tried to use interrupt INT0 of atmega16..
i wnt to disable interrupt once the program enters the INTERRUPT SUBROUTINE and enable the interrupt once the ISR gets over. but for the interruot to start for thr first time #asm("sei") needs to be given in the main()..
i want to enavle interrut once and then disable it in the ISR..
i have given my code below.
plz help..
interrupt [EXT_INT0] void ext_int0_isr(void)
{
#asm("cli");
delay_ms(4.752);
for(i=0;i<11;i++)
{
PORTC=PIND&&0x04;
PORTA=0x00;
delay_us(864);
PORTA=0x01;
delay_us(864);
}
PORTA=0x00;
delay_us(864);
PORTA=0x02;
delay_us(864);
PORTA=0x00;
}
void main(void)
{
PORTA=0x00;
DDRA=0xFF;
PORTB=0x00;
DDRB=0x00;
PORTC=0x00;
DDRC=0xFF;
PORTD=0x00;
DDRD=0x00;
#asm("sei");
while (1)
{
// Place your code here
};
}
i wnt to disable interrupt once the program enters the INTERRUPT SUBROUTINE and enable the interrupt once the ISR gets over. but for the interruot to start for thr first time #asm("sei") needs to be given in the main()..
i want to enavle interrut once and then disable it in the ISR..
i have given my code below.
plz help..
interrupt [EXT_INT0] void ext_int0_isr(void)
{
#asm("cli");
delay_ms(4.752);
for(i=0;i<11;i++)
{
PORTC=PIND&&0x04;
PORTA=0x00;
delay_us(864);
PORTA=0x01;
delay_us(864);
}
PORTA=0x00;
delay_us(864);
PORTA=0x02;
delay_us(864);
PORTA=0x00;
}
void main(void)
{
PORTA=0x00;
DDRA=0xFF;
PORTB=0x00;
DDRB=0x00;
PORTC=0x00;
DDRC=0xFF;
PORTD=0x00;
DDRD=0x00;
#asm("sei");
while (1)
{
// Place your code here
};
}