PDA

View Full Version : how to get pic to pic communication



kinsiro
- 29th August 2005, 19:36
hi, i m doing a IR project using pic16f84.. wat command should i use to write transmit a data from 1 pic(16f84) to another pic(16f84) thru ir transmitter n receiver??. i had tested the "serin & serout" but it seems cannot work... any suitable command?

wilfrieds
- 29th August 2005, 21:24
Hello there

I found this intesting program from Frank Sloep on the folowing web page
http://users.picbasic.org/projects/Garden%20timer/Garden%20Timer%20with%20Remote%20control-revu1.htm

Regards
Wilfried

arniepj
- 30th August 2005, 02:22
Take a look at this site.http://www.rentron.com/ under remote control projects.I used information from here for an IR project that worked perfectly.I used the serial commands and they work just fine.You will need to mix the serial data with the pwm signal thru an and gate as you will see in the rentron info.
Good luck

yettie
- 30th August 2005, 02:35
kinsiro,

good day. using the serin/serout commands will work well provided that it has proper hardware selection, initiated properly and written timely. just for instance: you might require MCP2122 (IR Encoder/Decoder) with IR txmitter/receiver if strict IR signal/protocol is required. then you can just send serial data directly using SEROUT command. upon receiving, your device must be waiting for incoming data, SERIN portb.0,T9600,"ID",....

If you might need help, you may want to post your work in details. thanks!

regards,

Bruce
- 30th August 2005, 05:27
OK.. Here's a super simple way to do this.

Take the code from this page: http://www.rentron.com/IR_TO_RF.htm. You'll need the MPASMWIN assembler from http://www.microchip.com

Burn a 10F200 with this code. Connect the DIN pin (shown in Figure #2) on the 10F200 to any pin on your existing PIC (that will send your IR data), and use "inverted" serial mode.

Build the IR receiver circuit shown in Figure #1 up to the 2N3906 PNP transistor with the 10K pull-down.

Replace the the RF trasnsmitter module with the receiving PIC (serial input pin).

Viola. You now have a way to transmit IR data by serial with a single 8-pin PIC that works up to 2400 bps.

Note: You'll need a good quality IR photo module like this one http://www.rentron.com/remote_control/PNA4602M.htm#1140 (and yes, it really does matter which IR module you use for reliable serial communications).

Why? Because IR modules have a MAX data rate. If you violate this (calm down Melanie..:o}), it simply does not work. This particular IR photo module works up to 3500 bps which is absolutely perfect for reliable 2400 bps serial IR data reception.

You will also want an IR LED that matches the "peak spectral sensitivity" of the IR photo module used for absolute maximum operating distance.

Why? Because the peak spectral sensitivity of the IR photo detector is fixed at a specific wavelength. For the TSOP1140 this is 940nm. When you use an IR LED that matches this wavelength, you get the absolute best operating range because you're transmitting at a wavelength the IR photo module is most sensitive to. This = maximum gain at the receiving end which is very important.

We have these IR LED's as well, but any 940nm IR LED will suffice. http://www.rentron.com/remote_control/IRLED.htm I think most Radio Shack stores carry IR LED's in this wavelength, but we've also got em.

I designed an IR wireless programming system for the BASIC Stamp a few years back that would program a Stamp (BS-II, BS-II SX, and BS2p series) from up to 75 foot from any PC running the Stamp compiler/tokenizer software (we offered a modified version of course) with a simple pre-programmed 8-pin PIC on the PC transmitter end very similar to this setup.

If you're interested in the PIC16F676 IR receiving end that actually receives IR data from the PC & programs the Stamp, drop me a line via email. I'll give you the full source code.

If you want to transmit & receive serial data by IR using simple PBP serout/serin commands, this works, period, and it's incredibly simple.

And if you really want to crank the data-rate up there, (I.E. up to 19,200 bps) with IR data communications, we've got a chip & the required parts for that too http://www.rentron.com/remote_control/TX-IRHS.htm

Can't give you the code for that one, but we definitely have the parts if you have the "need for speed"....;o}

kinsiro
- 30th August 2005, 17:12
thanks.. to all of u.. i will go to read all the information.. it mayb need some time to test.. hehe.. anyway i will post my problem if i face any... tx..