Ok, I own quite a few of the AT89S52 IC and the AT89C4051. Both have only UART, but my project requires two because the same device will control a radio module that requires a UART for interfacing and it will also communicate with the PC through serial port. As a last resort, I would use the parallel port to communicate with PC but the parallel port cable will be too bulky and my project needs to be several meters away from the PC.
I have researched and found IC's with dual UARTs but that may be a waste of time since I have to order them from ebay (china) and wait 6+ weeks for them on top of learning new 8051 commands to interface with them. I'd rather get things done easier and quicker than 5 weeks.
The only other idea I thought of is to use some sort of multiplexer/demultiplexer IC connected to the UART port so it doubles into 2 ports (I hope).
I plan to make all UART action will be half-duplex and time-sliced. By that I mean in one time frame, the micro sends data through UART to radio module, then in another time frame, the micro receives data from radio module, then in another time frame, the micro sends data to the PC then in the final time frame, the micro receives data from the PC.
Is this as simple as the following?:
connecting the micro transmit (data out) pin to an input of a multiplexer and each output to each device's UART transmit pin (where data is happily accepted)
connecting the micro receive (data in) pin to the output of a demultiplexer and each input to each device's UART receive pin and
connecting the address line of the demultiplexer/multiplexer to a gpio pin to allow me to select a UART.
or do I need to add resistors as well? and if I use cmos parts like 4051, would that affect performance if I decided to make all UART devices run at 115200bps?