Hey Guys,
I have a microcontroller with one hardware UART, but I have two peripherals that need UART communication. One is an IR transceiver, and the other is a FT231X for USB communication.
I only need to transmit to the IR transceiver, but I need to transmit & receive from the FT231X. They will never be used at the same time (the USB functionality is simply to reprogram the device or transfer some data to be stored into FLASH or EEPROM).
My question is, is there a clever way to use both peripherals on the same UART lines? I was thinking that if VBUS is detected (ie. USB plugged in and bus powered), I can disable the IR transceiver. Once it's disconnected and unpowered, I can enable the IR transceiver which would be on by default.
My only concern is that my system runs on 2V and so I would be applying 2V to the VCCIO line of the FT231X (for the internal level shifter). This means that if USB is unplugged, the device is not powered at VCC but I am still applying a voltage onto VCCIO. Furthermore, if I transmit data to the IR transceiver, the FT231X will also be seeing this on its input lines when VCC = 0. I'd like to avoid applying voltages on the pins if the chip is not powered at VCC.
Any simple suggestions? Perhaps the simplest solution would be to just get a micro with 2 UARTs and power VCCIO via a voltage divider or regulator from VBUS...but thought I would ask if there is a way to do it with one UART for curiosity sake.
Thanks.