abilashjoseph
Member level 1
hi,
i am using the interrupt in avr atmega16, while compiling the code there is no error , but at simulation the interrupt is not working. the code is given below. please help me, thanks.
#include <avr/io.h>
#include <avr/interrupt.h>
volatile int pulses=0;
ISR(INT1_vect)
{
pulses++;
}
int main(void)
{
int j =0;
int k ;
int l=0;
int m;
int i=0;
int g;
DDRB =0xff;
DDRD =0xf3;
DDRC = 0xff;
SREG =0x80;
GICR = 0xC0;
MCUCR = 0x05;
sei();
while(1)
{
PORTC = pulses;
cli();
}
}
i am using the interrupt in avr atmega16, while compiling the code there is no error , but at simulation the interrupt is not working. the code is given below. please help me, thanks.
#include <avr/io.h>
#include <avr/interrupt.h>
volatile int pulses=0;
ISR(INT1_vect)
{
pulses++;
}
int main(void)
{
int j =0;
int k ;
int l=0;
int m;
int i=0;
int g;
DDRB =0xff;
DDRD =0xf3;
DDRC = 0xff;
SREG =0x80;
GICR = 0xC0;
MCUCR = 0x05;
sei();
while(1)
{
PORTC = pulses;
cli();
}
}