Switching Circuit Increases Number Of USARTs Available From MCU

April 9, 2009
This design, based on a Maxim MAX220 RS-232 driver/receiver IC, allows you to increase the number of USARTs (universal synchronous, asynchronous receiver/transmitters) available on a microcontroller.

This design builds on a previously published Idea for Design (“Talk To Multiple Devices With One UART”). Our solution allows you to increase the number of USARTs (universal synchronous, asynchronous receiver/transmitters) available on a microcontroller with minimum hardware.

Typical 8- and 16-bit microcontrollers have one programmable USART for communication. But designers may need more USARTs for communication with two peripherals. A masterslave circuit communicating serially might also need another USART for connection to a computer.

Solutions include using dedicated serial ICs, designing software USARTs, and using remappable pins, I2C, or serial peripheral interface (SPI). However, these alternatives require strict timing sequences, and the pins required may be needed for other purposes. The circuit in the figure shows an alternative high-speed switching circuit that increases the number of available USARTs using minimum hardware and I/O pins.

Transistors Q1, Q2, Q3, and Q4 represent the receiver circuit block; Q5, Q6, Q7, and Q8 represent the transmitter circuit; and Q9 and Q10 form a TTL hex inverter. The inverter never sources current, so there’s no need for a totem-pole output. An I/O pin from the microcontroller is connected to Q9 and serves as the selection pin for the USARTs.

When the I/O pin is at logic zero, Node 1 is at logic low and Node 2 is at logic high. Thus, Q2 and Q3 are cut off, and the states of Q1 and Q4 depend on the instantaneous logic level of RXD1. When RXD1 is low, Q4 conducts and Q1 is cut off, and when RXD1 is high, Q1 conducts and Q4 is cut off. Therefore, at any time, either Q1 or Q4 conducts (is in the active region), and the voltage logic at RXD1 is made available at RXD, while RXD2 is completely cut off. Similarly, when the I/O pin is at logic one, Node 1 is high and Node 2 is low; Q1 and Q4 are completely cut off, and either Q2 or Q3 conducts. Therefore, RXD2 is connected directly to RXD.

The transmit circuit functions in a similar way. The table shows this operation.

High-speed transistors such as the 2N2907 and 2N2222 are preferable in order to minimize the propagation delay in the inverter, thus eliminating the need for the firmware to account for this delay. Very high transmission speeds (230.4 kbits/s) are possible with the use of such fast transistors. Additionally, with small modifications and the use of BJT-pairs and microcontroller pins, the designer can create more than two programmable USARTs.

This circuit is essentially a two-way switching circuit. The switching can also be accomplished with either tri-state buffers or multiplexers-demultiplexers. But these may cause power-supply problems because most of today’s systems run on 3.3 V or below. Also, these dedicated ICs require a lot of space. The circuit described here avoids these problems.

Sponsored Recommendations

What are the Important Considerations when Assessing Cobot Safety?

April 16, 2024
A review of the requirements of ISO/TS 15066 and how they fit in with ISO 10218-1 and 10218-2 a consideration the complexities of collaboration.

Wire & Cable Cutting Digi-Spool® Service

April 16, 2024
Explore DigiKey’s Digi-Spool® professional cutting service for efficient and precise wire and cable management. Custom-cut to your exact specifications for a variety of cable ...

DigiKey Factory Tomorrow Season 3: Sustainable Manufacturing

April 16, 2024
Industry 4.0 is helping manufacturers develop and integrate technologies such as AI, edge computing and connectivity for the factories of tomorrow. Learn more at DigiKey today...

Connectivity – The Backbone of Sustainable Automation

April 16, 2024
Advanced interfaces for signals, data, and electrical power are essential. They help save resources and costs when networking production equipment.

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!