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.
Hi frnds, I am using C8051F120, where I want to switch between 2 UARTS, Plz let me know how can we program to switch over two UARTS when it is needed? can we use common Timer1 as for Baudrate genration??
Rajesh
Each UART has its own set of SFRs - so you just pick the appropriate set!
if( use_uart_1 ) { // Use the SFRs for UART1 } else { // Use the SFRs for UART2 }
"can we use common Timer1 as for Baudrate genration??"
The Datasheet will tell you that!
presumably UART0 is connected to device a and UART1 is connected to device b.
so you feed UART0 with data for device a and feed UART1 with data for device b
whare is a switch in that picture??
Erik