Serial Comms: Reading the byte which caused a parity error


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Serial Comms: Reading the byte which caused a parity error

  1. #1
    Join Date
    May 2004
    Location
    South Australia
    Posts
    6

    Serial Comms: Reading the byte which caused a parity error

    Hi,

    I'm trying to implement a 9 bit protocol using C#.NET for an x86 embedded device running Windows CE.NET. At the moment i want to know if there is a way to read a character received from a COM port which caused a parity error, and how. The reason i need to do this is because the 9 bit protocol works such that slave devices are connected serially to a host/master PC. The host sends data to these slaves under the "Space" parity checking. When it wants to talk to a certain slave, it needs to send that particular slave's address by using a special control character with 9 bits. The PC sets the "9th bit" of the character (i will do this by setting the parity checking from "Space" to "Mark"). The devices detect this change in parity and raise a parity error. Now, how do i read the address specified with that character that caused the parity error?

    Kind Regards,

    J_Mak.

  2. #2
    Join Date
    Mar 2011
    Posts
    2
    Hello J_Mak
    I have the same problem, so were you able to resolve your issue and how did you fix it?

    Thanks

  3. #3
    Join Date
    Apr 2009
    Location
    United Kingdom
    Posts
    84
    Hi

    I am really interetsed to give some comments. However I can't follow the following lines. Can you explain a bit in detail.

    The PC sets the "9th bit" of the character (i will do this by setting the parity checking from "Space" to "Mark"). The devices detect this change in parity and raise a parity error. Now, how do i read the address specified with that character that caused the parity error?

    Questions for you ?

    (i). Are you developing your own protocol from the host side (PC) ?

    (ii).Serial communication should have 1+8+1 bits without parity. You are using 9 bits. This makes me confusing

    Faisal

  4. #4
    Join Date
    Mar 2011
    Posts
    2
    (i) I am not developing my own protocol, I have to follow one. I am on a the slave side.
    (ii) So basically when we say 9 bit protocol, this is done by changing parity of a part of the data. In our case when the master want to send data it send the first byte with parity set to Mark and the rest with parity set to space. On the slave side I'm set in parity Space and I need to read the proper value of the BYTE with parity error and just received a parity error. In .NET I lose the value of this BYTE, but not in Native c++ with ClearCommeError and SetCommMask function...

    Hope you it is a little more clear...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center