Re: Serial communication, detecting parity bits
- From: Mattias Brändström <"thebrasse at brasse dot org">
- Date: Wed, 25 Jan 2006 17:52:31 +0100
Tauno Voipio wrote:
kobus wrote:
IIRC, the Stick Parity bit in the 8250 -family of serial interfaces
by-passes the parity generation, creating a ninth bit which can be controlled with the even/odd parity bit. Similarly, a received ninth bit can be detected as a parity error state change.
I have now been able to look a bit more closely at the serial port api in Linux. It seems that I can detect parity errors by setting PARMRK bit with tcsetattr(). Since the protocol that I have to use does not use any parity but uses the wakeup bit I can set my serial port to use either even or odd parity and then bytes that has a parity error will be prefixed with the bytes 0xff and 0x00. This will enable me to calculate what value the wakeup bit had for each byte.
The only thing I worried about now is what will happen if my the data stream contains the combination 0xff 0x00. How do I know that that combination is legitimate data and not a parity error?
Maybe someone has a nice solution to this?
:.:: mattias .
- Follow-Ups:
- Re: Serial communication, detecting parity bits
- From: David Schwartz
- Re: Serial communication, detecting parity bits
- From: Tauno Voipio
- Re: Serial communication, detecting parity bits
- From: Floyd L. Davidson
- Re: Serial communication, detecting parity bits
- References:
- Serial communication, detecting parity bits
- From: Mattias Brändström
- Re: Serial communication, detecting parity bits
- From: kobus
- Re: Serial communication, detecting parity bits
- From: Tauno Voipio
- Serial communication, detecting parity bits
- Prev by Date: Re: running at boot time & signals
- Next by Date: Re: running at boot time & signals
- Previous by thread: Re: Serial communication, detecting parity bits
- Next by thread: Re: Serial communication, detecting parity bits
- Index(es):
Relevant Pages
|