CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

IR communication

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Bilal



Joined: 24 Apr 2010
Posts: 75
Location: Islamabad

View user's profile Send private message Send e-mail

IR communication
PostPosted: Sun May 22, 2011 9:21 am     Reply with quote

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

View user's profile Send private message Visit poster's website

PostPosted: Sun May 22, 2011 12:07 pm     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Tue May 24, 2011 12:50 am     Reply with quote

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

View user's profile Send private message Visit poster's website

PostPosted: Thu Jun 02, 2011 3:07 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Jun 02, 2011 3:52 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group