I’m designing an RS232 router and I’d appreciate some advice from people who have used RS232 devices such as GPS loggers etc. I have a PC controlling all sorts of things around the house and as the number of devices grows I have an increasing need for some sort of standardised communication system. A common Wire-OR bus has served very well up to about 15 devices but data clashes are now getting more common and sometimes I arrive home at night and the lights don’t come on!
I had an idea about routing little RS232 packets via picaxes but the problem with this approach is that the number of data bytes in a packet is limited to the 14 registers (b0 to b13). So this is great for a propriatory system but isn’t so useful for a system where unknown future devices might be added. It is quite possible that one day I might want to add on a device that uses standard RS232 and produces a whole stream of data that is much longer than 14 bytes.
So that limits the design to a router that is simply a multiplexer for the single RS232 connection on the PC. Asynchronous comms using just Tx and Rx and ground will work, but I’m thinking it may be better to at least use the Request to Send line as well which is an output from the PC to a device. The PC can control a picaxe which controls a multiplexer. Say there were 8 RS232 lines – the PC could poll each one sending out a RTS in turn to each and then a burst of Tx data and the device would respond with a packet. Devices that need to alert the PC to a data change can simply hold their data until they are polled and if the polling happens many times a second then the data will go through fast enough. The serin hang is not an issue as the RS232 lines simply go through to the PC and the PC RS232 input buffer can handle a hang.
I think this can be done with 4 wires – Gnd, Tx, Rx and RTS.
The question I would appreciate an answer to is whether there is a need to also multiplex CTS which is the signal from the device to the PC saying it is clear to send. And also whether DTR is needed? Are there common RS232 devices where these lines are essential?
I had an idea about routing little RS232 packets via picaxes but the problem with this approach is that the number of data bytes in a packet is limited to the 14 registers (b0 to b13). So this is great for a propriatory system but isn’t so useful for a system where unknown future devices might be added. It is quite possible that one day I might want to add on a device that uses standard RS232 and produces a whole stream of data that is much longer than 14 bytes.
So that limits the design to a router that is simply a multiplexer for the single RS232 connection on the PC. Asynchronous comms using just Tx and Rx and ground will work, but I’m thinking it may be better to at least use the Request to Send line as well which is an output from the PC to a device. The PC can control a picaxe which controls a multiplexer. Say there were 8 RS232 lines – the PC could poll each one sending out a RTS in turn to each and then a burst of Tx data and the device would respond with a packet. Devices that need to alert the PC to a data change can simply hold their data until they are polled and if the polling happens many times a second then the data will go through fast enough. The serin hang is not an issue as the RS232 lines simply go through to the PC and the PC RS232 input buffer can handle a hang.
I think this can be done with 4 wires – Gnd, Tx, Rx and RTS.
The question I would appreciate an answer to is whether there is a need to also multiplex CTS which is the signal from the device to the PC saying it is clear to send. And also whether DTR is needed? Are there common RS232 devices where these lines are essential?