i have a problem with the UART-interface. I need 2 serial-interfaces (1 for debugging) in my project and there for I've written a small function to switch between the pins. The problem is that I become 0xFF on the UART even if nothing transmitted in the main loop. When I transmit some data, 0xFF will be attached to the begin of transmitted sentence. Here is the code I've used. I hope, somebody can explain me that issue.
P.S.: This problem only appears at higher baud-rates (i.e. 115200).
static const int RXPin = 2, TXPin = 3;
static int switch_flag;
// Switch Serialports
void serial_switch(int nr)
Attached is a screenshot how it looks like in HTerm after uploading the upper sketch.