I am trying to understand why I get a CE_FRAME error in CRIC communication reads the documentation:
The hardware has detected a framing error when returning the SERIAL_LSR_FE bit in the LSR hardware register.
This is a framing error indicator whenever the hardware detects that the incoming serial data unit does not have a valid stop bit, it is set. It is a bit clearer by reading this register: Define
SERIAL_LSR_FE 0x08
but I do not really know that this valid stop bit . Can i ignore it
I have no other problem with communication, every packet of data (sent by device) is being caught on the PC. On PC I am using the ClearCommError ()
to locate the channel's data, and I have received this CE_FRAME flag from time to time. I'm not sure that I have to give details about the CreateFile ()
and SetCommState ()
function call in my code, because there is nothing special about them. But if necessary, I can do it.
If you are programming on Windows then the application programmer does not start and to stop bits , 'System' takes care to introduce start / stop bits as well as possible equality bits, baud rate and even some other settings. Important people start and stop baud rate, bits and parity bits
is the system hardware or operating system. I think this is a URT chip that adds start and stop bits. But you need to set up a real configuration to use in the software.
What you have to do is to set the beginning and stop bits to end both, so if you are communicating with a device that uses 1 start bit and 2 stop bit, So you have to set this same setting for your communication end.
If you do not have these settings then you will get framing errors. Set the same set on both ends of the communication I have seen errors of framing, for example I had placed the baud rate at 1200 one end, but at the other end, 9600, both of my start and stop bits were set correctly So it could well be something like this.
No comments:
Post a Comment