Hello All,
I am using MSC1212Y5 Microcontroller. It has two serial ports. I have directed printf to second serial port by changing putchar.c file in keil library. At the same time I am using first port for transmitting single characters only. i.e. 'T' ..'R'..etc. But whenever i try to use printf for both ports, of course by disabling one port for some time then it is not working..it sends data to only second serial port.
You have to modify putchar() to do:
if (output == UART1) { ... } else { ... }
and you have to switch output to specify UART1 or UART2 depending on which serial port that should get the data from printf().
Each individual branch has to make use of the registers for that specific UART.