shukla0
Newbie level 4
- Joined
- Jul 6, 2013
- Messages
- 5
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 49
hi
i am trying to make a project to control the peripherals devices using tv remote...now the ir sensor i'm using is working properly with the remote,checked it with leds on bread board.
the problem is when i connect the output pin to INT0 and press any button , it should go to ISR and just flick the led's on or off . but it does not seem to go to the ISR only .
i checked voltage ... between out and gnd,its 5v normally and 1.45 arnd when i press a button .
now is the problem ,the voltage not dropping to zero and if it is , how to solve it ??
else my code is as follows
#include <avr/io.h>
#include <avr/interrupt.h>
#define INPORT PIND
#define OUTPORT PORTC
#define OUTDDR DDRC
ISR( INT0_vect )
{
OUTPORT=~(OUTPORT); // toggle LED
}
void int0_init( void )
{
EICRA =0x02; // enable negative edge on INT0
EIMSK=(1<<INT0); // enable INT0
}
int main( void )
{
OUTDDR = 0xff;
OUTPORT = 0xAA;
int0_init(); // configure INT0
sei(); // enable interrpt
while (1); // loop forever
return(0);
}
please help !!!
i'm going crazy over it... :'(
i am trying to make a project to control the peripherals devices using tv remote...now the ir sensor i'm using is working properly with the remote,checked it with leds on bread board.
the problem is when i connect the output pin to INT0 and press any button , it should go to ISR and just flick the led's on or off . but it does not seem to go to the ISR only .
i checked voltage ... between out and gnd,its 5v normally and 1.45 arnd when i press a button .
now is the problem ,the voltage not dropping to zero and if it is , how to solve it ??
else my code is as follows
#include <avr/io.h>
#include <avr/interrupt.h>
#define INPORT PIND
#define OUTPORT PORTC
#define OUTDDR DDRC
ISR( INT0_vect )
{
OUTPORT=~(OUTPORT); // toggle LED
}
void int0_init( void )
{
EICRA =0x02; // enable negative edge on INT0
EIMSK=(1<<INT0); // enable INT0
}
int main( void )
{
OUTDDR = 0xff;
OUTPORT = 0xAA;
int0_init(); // configure INT0
sei(); // enable interrpt
while (1); // loop forever
return(0);
}
please help !!!
i'm going crazy over it... :'(