PDA

View Full Version : Arbitration of 232 signals



blmcali
- 12th July 2012, 23:17
My system consists of (2) PICs, and a third 'device' receiving/transmitting 232 signals. Both PICs need to talk to the 'device' via 232.' The device only has one 232 port.

So how can i separate communication between the two PICs? Do I have to use a third micro to separate the signals?

Any have or know of a buffering algorithm i can use as a template?

Jumper
- 13th July 2012, 04:06
Hi,

Can you use an extra wire in the cable that is usually pulled up. Then talking pic can can check if this signal is High (tx line free to use) and then pull it low and start the TX to the device. If the PIC sees the wire low it knows it has to wait for the signal to go high (released by the other pic) before it can take control of the signal and do TX.

Pin 8 in the 9-pin rs-232 connector CTS (clear to send) or pin 7 RTS might be used for this but you will need to pullup the signal so the transmitting PIC can ground the signal when it is in control of it (TRIS.x reg to output and port.x to 0). When finished transmitting the pic sets the pin's TRIS.x register to an input to make it 3-state (floating).

Hope fully you can change your HW and then this a simple and cheap solution.