Resistor implements half-duplex RS-232 with echo
Matt Bennett, Austin, TX -- EDN, November 24, 1999
A previous Design Idea ("Single µC pin makes half-duplex RS-232," EDN, Aug 5, 1999, pg 118) presented a way to implement half-duplex RS-232 communications without echo. Sometimes, an echo is desirable in a µC application. You can obtain the echo by using a single resistor (Figure 1). You insert a 5.1-kW resistor between the transmit and receive pins on the RS-232 driver (such as a MAX232). The I/O pin on the µC (RB0 on 14-bit PIC µCs) connects directly to the transmit gate on the RS-232 driver. This technique is useful for implementing a user interface on a Microchip PIC for applications in which you communicate to the PIC via a terminal or a terminal-emulation program. Full duplex is unnecessary with a user interface based on user-issued commands and µC responses, when the µC generates no spontaneous data that would mask the user-issued commands. The character echo is useful in determining whether the device is powered up and the RS-232 receiver is active, but an echo alone does not tell you whether the µC is active; the µC must send data.
When the µC is in receive mode, it makes the input pin a high-impedance input. All RS-232 data sent to the µC is immediately retransmitted via the resistor that connects the receiver to the transmitter. Because the input has high impedance, the µC is essentially just monitoring the traffic on the RS-232 line. When the µC must send serial information, the µC converts its I/O pin to a low-impedance driver. Anything now sent to the µC shunts to ground or VCC (depending on the µC's output state) through the resistor and the µC's driver. The µC ignores data sent to it. The µC now directly sends data down the serial line. The µC must immediately change the serial line back to high-impedance mode after transmitting or risk data loss. (DI #2445).


















