piclist 2002\10\10\153814a >
Thread: General Serial Tips
face BY : Russell McMahon email (remove spam text)

I just KNOW someone can cut this down in length and add clarity, but here's
my straw man:


In RS232 ( also ~= V24) asynchronous transmission, end to end
synchronisation occurs on a character by character basis. When the receiver
"sees" the start bit it waits 1.5 bit times (until the middle of the first
data bit), samples the value of the data bit and then continues to sample
until all data bits have been input. It then waits another bit time and
samples once more to confirm that a valid stop bit is present. If the
transmit and receive speeds are consistently slightly different the sampling
point will "drift" further away from the middle of the bit on each
subsequent bit. If there is too much difference the sampling point will fall
outside the intended bit and received data will be incorrect. Limiting
acceptable difference in send and receive data rates occurs when the
sampling of the stop bit JUST occurs at either the leading or trailing edge
of the stop bit. This occurs when the error is enough for the sampling point
to have "drifted" half a bit during transmission. If there are S start bits,
D data bits, P parity bits  and E stop (end ) bits then the error involved
is about 0.5 / [S+D+ P + (E-0.5) ] x 100%. (The bottom line is the distance
in bits from the leading edge of the start bit to the middle of the last
stop bit). For 1 start bit, 8 data bits, 0 parity bits and  1 stop bit the
allowable error is
0.5 / (1 + 8 + 0 + 1 - 0.5) x 100% = 0.5/ 9.5 x 100% = 1/19 x 100% = 5.26%.
Usually said to be 5% error for standard N81 transmission.

Note that this error speed is the maximum net error allowed for BOTH
transmit and receive clocks. If both transmit and receive clocks are 5%
maximum error (e.g. typical internal RC oscillator worst case spec) the
worst possible net error is about 10% and 'there will be trouble". Such an
arrangement will often work due to error often not being worst case and some
components of error sources often (but not always ) being shared by
transmitter and receiver (e.g. both at about the  same temperature if in the
same location or both in human accommodation.)

A ceramic resonator has ample accuracy to guarantee the required accuracy if
used at both ends. A crystal even more so. Use of a ceramic resonator or
crystal at one end and a good RC oscillator at the other will often result
in good operation. "Clever" schemes can be devised which determine the
minimum time between received bit edges "on the fly" and use this as 1 bit
time and adjust the clock speed accordingly. This allows the use of very
inaccurate clocks as long as the clock can be adjusted by the system. Bit
length measurement is also the basis for some auto-baud rate detect schemes
which determine the correct link speed by having the user enter a
predetermined character at start up.


{Original Message removed}
<009501c2709d$005a75e0$2301a8c0@Paradise> 7bit

See also: www.piclist.com/techref/io/serials.htm?key=serial
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) General Serial Tips

month overview.

new search...