Long distance Communicating between PICs
Good day Picers
Does anyone know what is the maximum cable length that 2 PICs can communicate over, or is there another way to do for instance 30 meter communication.
Is it also possible to share one power source over the long distance cable?
I want to have 1 base station that communicates with a couple of client stations with between 5 meters and 30 meter distance between the stations?
Thank you very much
koossa
RS422/485 or transformer isolation needed
RS 422 and RS 485 are well established hardware approaches for medium distance data communications up to a few hundred kbps. They were designed for factory systems, essentially under one roof and powered by one substation. They are both tolerant of ground potential differences of about 15 volts. For more reliable longer distance communications nothing beats transformer isolation which can tolerate ground differences to thousands of volts. With both the above you will probably need to use Bi-Phase modulation or possibly Manchester coding.
Radio is not as simple as may first appear but might also be a good alternative up to a few hundred metres. Bi-Phase modulation is best IMHO and Manchester a good second place for radio.
Within one laboratory where all devices are powered off one phase of the mains, you can get away with one power source for the entire system and sending ground, power and data to/from remote devices up to about 50 metres at 50 kbps over ribbon cable. Double up the power and ground wires and make sure you terminate the data (and any clock) lines with a 120 Ohms, 100 nF network to suppress ringing. I use this routinely with a five wire interface. One pin is ground, another power. A third is the ATTention line, another the ACKnowledge line. The fifth wire is the DATa line. Lines 3, 4 and 5 are bidirectional and use weak pullups or 1 k for longer distances. This lets me set up a peer to peer network with 16 or more devices over about 50 metres at 57600 bps.
To send, a station looks at the ATTention line and if it is high (the idle state), it pulls it down and starts broadcasting the destination address on the DATa line. When the destination gets around to checking the communications interface it seen the ATTention line low and its own address on the DATa line. It then responds by pulling the ACKnowledge line low . The calling party now sees the ACK line go low so it starts broadcasting the checksummed data packet to the desired destination. The sender keeps repeating the packet until the ACK line is released by the destination. That signals the message has got through error free.
Any station can call any other station and devices that are very busy do not have to spend much time looking for the ATT line low and their address on the DATa line.
HTH
Brian