Serial Comms: Reading the byte which caused a parity error
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?
I have the same problem, so were you able to resolve your issue and how did you fix it?
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
(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...
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center