Lets say I want to send 11110000
data with rs-232. Start bit is 1
and stop bit is 0
and I will use even parity. How does parity bit work here? Does it only check my data and becomes 0
or check whole bits and become 1
?
Does parity check includes start and stop bits on RS-232?
2k views Asked by hbk At
1
The start and stop bits are for framing, and not part of the parity calculation.
Only the data bits are involved in the parity calculation.
The parity bit is an additional bit that is set to a value to make the total count of ones (the parity) to match the parity setting.
In your example of
11110000
, there are four bits of ones. Four is an even number. Since you specify even parity, the parity bit should be zero so that the count of ones stays at an even four.If you had specified odd parity, then the parity bit should be a one so that the count of ones would be five, an odd number.
Actually it's the other way 'round.
The start bit is a space or
0
. The stop bit(s) is a mark or1
.With RS-232, space is a positive voltage, and mark is a negative voltage.
So RS-232 timing diagrams typically show space (0) above mark (1) on the Y-axis, just like an oscilloscope.
Reference: http://www.cmrr.umn.edu/~strupp/serial.html#2_3