Hi,
I have a problem with my RX interrupt triggering even though there's nothing on the RX line. Subsequently the RX buffer is 0, and that gets inserted into my FIFO, resulting in incorrect data.
This happens only when I reinitialize the UART. What I'm doing is initializing my UART once I detect a device has been connected. When the device is disconnected, I disable my UART simply by disabling the RX/TX interrupts. Then, if the device is detected again, I will initialize the UART again, including setting all the SFRs(baudrate, etc) and enabling the RX/TX interrupt.
I have no problem with the first time the device is detected and the UART is initialized. All transfers are perfectly normal. However, on the 2nd time, right after I initialize my UART again, very soon after the RX ISR gets called(almost always twice in succession, and hence 2
0x00s are inserted into the FIFO.I've traced this on a logic analyzer and there's no data on the RX line at all, so I'm not sure why the RX interrupt is triggered, why it's triggered twice, and why it's triggered only on the 2nd time.
Any ideas?