Serial Port Complete - Latest Microcontroller projects

(lily) #1
Inside RS-485

The 1-shot uses the Start bit to detect when a byte begins to transmit. Each
byte begins with a falling edge that signifies the Start bit. Capacitor CT and
resistor RT set the width of the 1-shot’s output pulse to slightly longer than the
time to transmit one byte.


On the falling edge of the Start bit, the one-shot’s output goes high for at least
one delay time. Because the 1-shot is retriggerable, if another byte begins to
transmit before the 1-shot times out, the new byte’s Start bit holds the output
high until that byte has finished transmitting. If another byte doesn’t arrive,
soon after the last byte’s transmission is complete, the one-shot’s output goes
low and the driver is disabled.


Because the 1-shot retriggers on every falling edge, the time that its output
remains high varies depending on the data sent. If bit 6 = 1 and bit 7 = 0, the
falling edge at bit 7’s transition to zero will retrigger the 1-shot and result in a
longer pulse. (Remember that the data transmits least-significant-bit first.) But
if the byte is all 1s or all 0s, the 1-shot triggers only on the falling edge of the
Start bit, and the pulse is shorter.


Otherwise, a jumper or switch can match the delay time to the bit rate. Com-
ponents selected to work at the slowest expected bit rate will result in much
longer delays than needed at faster bit rates.


The 1-shot’s delay isn’t precise, so you’ll need to allow a margin of error when
selecting components. The driver thus is likely to remain enabled longer than
needed, and the node that transmits next must delay before enabling its driver.


! & 


,$ 0
,
 
 



USB/RS-485 converters can use FTDI Chip’s FT232R USB UART. This USB
device controller has an asynchronous serial interface and an output that is high
while data is transmitting. Chapter 15 has more about this chip.

Free download pdf