View previous topic :: View next topic |
Author |
Message |
Bilal
Joined: 24 Apr 2010 Posts: 75 Location: Islamabad
|
IR communication |
Posted: Sun May 22, 2011 9:21 am |
|
|
Hi. I have a IR decoder of 40KHz carrier and attach it to my serial receiver of my PIC16F876A, and make a Astable multivibrater of 40KHz with 555 timer and attach its reset (PIN 4) with my serial tx pin of my PIC16F877A.. and its output (PIN 3) to an IR LED.
I set same baud rate of both my PICs (9600).
I try to send a character 'K' from serial PIN (of PIC16F877A) through IR LED and want to receive that character through the IR decoder to reach it tx PIN of PIC16F876A and display it on LCD.
But I receive garbage characters.
I try to reduce the Baud rate to get enough pulses of 40KHz with pulses of data, but no use.
Please help me with this.
I will be very thankful. _________________ ... |
|
|
Rohit de Sa
Joined: 09 Nov 2007 Posts: 282 Location: India
|
|
Posted: Sun May 22, 2011 12:07 pm |
|
|
How is the LED connected to the 555 output? Is the 555 a source or a sink? Try inverting the output (active high to active low, or vice versa).
Rohit |
|
|
Bilal
Joined: 24 Apr 2010 Posts: 75 Location: Islamabad
|
|
Posted: Tue May 24, 2011 12:50 am |
|
|
i apply a not gate after my decoder.. then apply on receiver of my PIC16F876A.. problem is solved and data is receiving..
but a baud rate is a problem.. at dont work on 9600 _________________ ... |
|
|
Rohit de Sa
Joined: 09 Nov 2007 Posts: 282 Location: India
|
|
Posted: Thu Jun 02, 2011 3:07 am |
|
|
You haven't mentioned what receiver you're using, but I'm assuming it is one of the TSOP17xx type or IR demodulators. The datasheet, apart from several other things, says that the burst length should be a minimum of 10 cycles. At 40kHz, this takes up 0.025ms. At 9600 baud, one bit 'occurs' every 0.104ms; ie about four times the minimum time required by the TSOP. You should not really have a problem transmitting data, as long as you stick to the timing specs.
Rohit |
|
|
gpsmikey
Joined: 16 Nov 2010 Posts: 588 Location: Kirkland, WA
|
|
Posted: Thu Jun 02, 2011 3:52 am |
|
|
Not sure which receiver you are using, but a quirk I ran into some time ago with some of those receivers is you can't feed them an unmodulated carrier - it tends to saturate in one direction. If your circuit is sending a continuous carrier to the receiver between characters, I think you will run into a problem if that is the case (in that case, using a much lower baud rate would allow the receiver to lock on again which would give you the problem you see with not handling the 9600 baud). It's been a few years since I worked with them, but that may be the issue.
mikey _________________ mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3 |
|
|
|