Henry, I did a similar ciruit on my last project - due to a shortage of spare pins on the micro I was using I used the leading edge of the start bit to discharge a capacitor. Rom memory I could switch to TX in under 1uS which was quite adequate. The cap would then discharge on all the falling edges and slowly charge otherwise. It seemed to work OK although the delay in changing back to RX depended on the final byte (and changing the bit rate changed the minimum required delay). In the end I managed to recover a spare micro pin & used that instead. We normally buy in RS232 to RS485 converters so I can't comment on the use of the handshake lines. I have had problems with the converters triggering on capacitive coupled pulses between the TX and RX line - on longish lines it led to a lockup type situation that was quite hard to track down the first time we came accross it This would suggest that the converters we use rely on a similar TX-RX switch mechanism - especially as we typically only use 3 wires. RP On 11/05/06, Henry Hallam wrote: > Hi All, > I am putting several PICs on 2-wire RS485 bus. They all need to > communicate with a laptop computer so I am exploring different options > for connecting the computer to the bus. > > 1. A PIC using its UART on the 485 bus and bit-banging 232 to the > computer (or the other way around). I'm not terribly happy about the > bit-banging, especially at higher data rates, although I probably won't > be operating it very fast. > 2. Two PICs, one with UART on 232 and one with UART on 485, interlinked > over SPI. Seems a bit clumsy. > 3. Direct conversion. A MAX232 connected to a MAX3158 or similar RS485 > transceiver. Only tough bit is turning on the "driver enable" pins on > the transceiver. Could the RTS line from the 232 connection be used for > this if the PC is set to Hardware flow control? What I mean is, if I > set Hyperterminal to RTS/CTS handshaking will it automatically turn on > the RTS line for the duration of each byte? If not perhaps I could > achieve the same goal manually by writing software that turns on the RTS > line, sends a whole packet of data then turns it off again. > Alternatively I saw this page: > http://www.edn.com/article/CA74434.html?1=1 which uses a 555 timer as a > monostable, triggered by the start bit in the RS232 byte. However this > means picking a fairly narrow range of baud rates, and means that the > other nodes on the 485 bus need to wait a certain amount of time before > transmitting. > > Related question: is there an easy/"clever" way of enabling/disabling > the RS485 drivers on a PIC communicating on a 485 bus when using the > internal UART? I was thinking of enabling them when writing to TXREG and > then disabling them in the TX interrupt. > > Thanks very much for your time. > > Henry Hallam > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist