We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hey,
I have a problem with my UART. It runs as long as the RS232-Cable to the PC is connected, but once I unplug it(i.e. the TxD and RxD Pins are open), the UART stops sending data. Is this a correct behaviour or am I doing something wrong?
"..., but once I unplug it..., the UART stops sending data."
How exactly is your PC setup? Do you have a dumb terminal at the PC side or do you have a app-specific program?
Is your code just echoing the chars you type in the PC terminal program?
If you have a slave protocol running on the uC, your UART may be stopped simply because of flow control or protocol issues.
If you are hot-unplugging the RS232 cable, your UART may just get framing errors, and stall the serial link. To prevent this, you must check for framing errors (read the FE bit) in the UART receive handler, and reset the UART in such cases.