Re: Serial communication, detecting parity bits



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
.



Relevant Pages

  • Re: wince serial driver
    ... I am using the parity bit as a signal bit ... it raises a parity error. ... But if I try to port the application to an ARM platform ... >> The Data Read out is from IST and WaitCommEvent is call from Application ...
    (microsoft.public.windowsce.platbuilder)
  • Re: wince serial driver
    ... even if it causes a parity error. ... driver of an ARM platform discards bytes arriving with an parity error. ... >> The Data Read out is from IST and WaitCommEvent is call from Application ...
    (microsoft.public.windowsce.platbuilder)
  • Re: wince serial driver
    ... even if it causes a parity error. ... driver of an ARM platform discards bytes arriving with an parity error. ... >> The Data Read out is from IST and WaitCommEvent is call from Application ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Serial communication, detecting parity bits
    ... the Stick Parity bit in the 8250 -family of serial ... >bytes that has a parity error will be prefixed with the bytes ... >wakeup bit had for each byte. ... >data stream contains the combination 0xff 0x00. ...
    (comp.os.linux.development.system)
  • Re: checking for parity bit in serial frame
    ... but the parity bit indicates the start of an individual message. ... This sort of protocol was once quite common in micro controller world ... Communication between the master and slave are through a serial ... data link operating at 19.2 kbaud in a "wakeup" mode. ...
    (microsoft.public.win32.programmer.kernel)