Re: Serial communication, detecting parity bits
- From: floyd@xxxxxxxxxx (Floyd L. Davidson)
- Date: Wed, 25 Jan 2006 08:49:26 -0900
Mattias Brändström <"thebrasse at brasse dot org"> wrote:
>Tauno Voipio 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?
Are you using 8 bit bytes or 9 bit bytes as described by
Tauno Voipio above?
--
Floyd L. Davidson <http://www.apaflo.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska) floyd@xxxxxxxxxx
.
- 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
- Re: Serial communication, detecting parity bits
- From: Mattias Brändström
- 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
|