Hello everyone!
I am testing a simple Uart communication over 115200 bps.
Everything works fine, I can transmit and receive data as I please.
However, just in order to handle errors, I intentionally cause an overrun error (by sending lots of data to the uC as possible).
The overrun happens, ok.
The following code is generated by the CODE GENERATOR to clear the flags properly whenever an overrun happens.
I checked, double-checked, and the flags are being reseted.
However, once a single overrun ocours, all the following incoming data also triggers an overrun, even if it is a single byte.
I assumed that whenever the flag is reset, the communication would be able to resume.
Furthermore, I even tried to stop and start the SCI again but that didn't help.
To sum up: What do I have to do to recover from an overrun, since reseting the flag doesn't seem enough?
Thanks a lot! =]
Hi, we use an RX63n so don't know how close this is to the RX111 hardware but this is the code we use to clear the error if (1 == IS(SCI0,ERI0)) { // check that the rx interrupt is enabled in the UART and that there is an error if(0 != SCI0.SCR.BIT.RIE) { // Confirm that the flags are clear while (0x00 != (UART0_SERIAL_STATUS_REG & SSR_ERROR_FLAGS)) { // Read the register to allow the error flag to be cleared. u16Dummy = UART0_RECEIVE_REG; // ---- Clear the error flags ---- UART0_SERIAL_STATUS_REG = (UART0_SERIAL_STATUS_REG & ~SSR_ERROR_FLAGS) | 0xC0; } } } where #define UART0_SERIAL_STATUS_REG SCI0.SSR.BYTE #define SSR_ERROR_FLAGS 0x38 Paul.