Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

INTErfacing IR sensor ATMEGA64 problem

Status
Not open for further replies.

shukla0

Newbie level 4
Newbie level 4
Joined
Jul 6, 2013
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
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'm a newbie
well i used one , not knowing proper value , and well all that happens is , the voltage drops , i.e. both the normal and when button pressed voltages (still doesnt reach zero)
but if u could help me with the value i could use it would be great !!!
is there any other way , like using a transistor as a switch maybe...although i just know that it works as it , dunno how to properly select values of resistances ...
so just help a poor guy out ... anything would do !!! m okay with coding stuff but this hardware stuff doesnt click !!
 

IMG02144-20130705-1813.jpg

sorry i had to draw it cuz the breadboard was messy .... if anything or everything is wrong just tell me what to do !!
 

also what value of pull down should i use !!
and well with the resistance of 10k and also 100 ... its still not going to zero in any case !!
if there's another circuit for it ... please tell me , i dunno how i got hold of this circuit too even ,so i cant be sure what i'm doing is right
(with 100ohm resistor values drop to .12 and .10v , obviously ) !!
 

Mention the IR sensor you are using. Let me check its datasheet. If you are using TSOP 1738 then you don't need any resistors. Connect pin 1 to gnd, pin 2 to +5V and pin 3 to uC.

What is this #define INPORT PIND

which pin of PortD is input pin. PIND0?
 
Last edited:

yup its pin D0 only...and that define thing is just naming it...i can use INPORT in place of PIND...thats there because i modified an original code that i got from somewhere
but now i think i get the problem...its the speed,the bits get transmitted at a very high speed ... probably that is the reason m not able to see 0 volts in the multimeter
m working now on a program to collect the bits and well ... will assign it a name such as "button 1" and use comparing and stuff
thanks anyways ... i'll be sure to check in with you if i face any problem after that also !! :)

@snishant
well i just saw it in a datasheet .... nothing else !! it was written as optional there ,may be it is just the pullup resistor you were talking about !!
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top