Home > Software engineering >  Understand the great spirit of the serial port in ~ ~ ~ ~
Understand the great spirit of the serial port in ~ ~ ~ ~

Time:09-24

OVERLAPPED OS;
WaitCommEvent (m_idComDev, & amp; DwEvtMask, & amp; OS);

After using a serial port turn USB line,
If ((dwEvtMask & amp; EV_ERR)==EV_ERR)
Go to the error

Serial receiver to read data sort the following function
ClearCommError (m_idComDev, & amp; DwErrorFlags, & amp; The ComStat);
One dwErrorFlags returns 0 x0008 (CE_FRAME)


Internet has examined the EV_ERR has the following three
CE_FRAME 0 x0008 The hardware detected a framing error.
CE_OVERRUN 0 x0002 character - A buffer overrun has occurred. The next character is lost.
CE_RXPARITY 0 x0004 The hardware detected a parity error.

Online there are very few three incorrect interpretation, a great god answers, what will be the 3 kinds of mistakes!!!!!!

CodePudding user response:

Special transceiver the conditions [edit]
Overrun error [edit]
An "overrun" error occurs when the receiver always process the character that just came in before the next one arrives. Various devices have marketers amounts of buffer space to hold a received characters. The CPU or the DMA controller must service the UART in order to remove characters from the input buffer. If the CPU or the DMA controller does not service the UART quickly enough and the buffer becomes full, the An overrun error will occur, and incoming characters will be lost.
Underrun error [edit]
The An underrun "error" occurs when the UART transmitter has completed sending a character and the transmit buffer is empty. In asynchronous modes this is treated as An indication that no data remains to be transmitted, rather than An error, since additional stop bits can be appended. This error indication is commonly found In USARTs, since An underrun is more serious In synchronous systems.
Framing error [edit]
"A" framing error occurs when the designated "start" and "stop" bits are not found. As the "start" bit is 2 identify the beginning of an incoming character, it ACTS As A reference for the remaining bits. If the data line is not in the expected state (hi/lo) when the "stop" bit is expected, A framing error will occur.
Parity error [edit]
A Parity Error occurs when the Parity of the number of 1 bits disagrees with that specified by the Parity bit. The Use of A Parity bit is optional, so this Error will only occur if Parity - checking has had enabled.
Break condition [edit]
A "break condition" occurs when the receiver input is at the "space" (logic low, i.e., '0') level for longer than some duration of time, typically, for more than a character time. This is not necessarily an error, but appears to the receiver as a character of all zero bits with a framing error. The term "break" derives from current loop signaling, which was the traditional signaling used for teletypewriters. The "spacing" condition of a current loop line is indicated by no current flowing, and a very long period of no current flowing is often caused by a break or other fault in the line.
Some equipment will deliberately transmit the "space" level for longer than a character as an attention signal. When signaling rates are mismatched, no meaningful characters can be sent, but a long "break" signal can be a useful way to get the attention of a mismatched receiver to do something (such as resetting itself). Unix-like systems can use the long "break" level as a request to change the signaling rate, to support dial-in access at multiple signaling rates. The DMX512 protocol uses the break condition to signal the start of a new packet.

CodePudding user response:

A search for "Universal asynchronous receiver transmitter -"

CodePudding user response:

CE_FRAME 0 x0008 The hardware detected a framing error.//frame errors, such as insufficient digits or more than
CE_OVERRUN 0 x0002 character - A buffer overrun has occurred. The next character is lost.//The buffer overflow, buffer is full, will no longer receive data
CE_RXPARITY 0 x0004 The hardware detected a parity error.//hardware parity error, The value of The check digit and data is not in conformity with The
  • Related