Bidirectional RS-232 Communication Uses Only One I/O Line

May 15, 2000
Occasionally, when designing with microcontrollers, it’s necessary to include a bidirectional serial communications capability, but, only a single I/O line is available. This situation can be accommodated, though, if the transmission and reception...

Occasionally, when designing with microcontrollers, it’s necessary to include a bidirectional serial communications capability, but, only a single I/O line is available. This situation can be accommodated, though, if the transmission and reception directions are well defined. In other words, the microcontroller system and the peripheral system should work as a transmitter/receiver pair or vice versa, and never as a transmitter/transmitter pair.

An RS-232 driver like the MAX232 needs to be included in the design to meet the requirements specified for EIA232-C voltage levels. The TTL-side of this interface driver enters into a single microcontroller line (see the figure). Only resistor R has to be determined to detect the incoming data and the transmission within the proper voltage range possible. The possible scenarios are as follows:

  1. The microcontroller tries to output a low to the RS-232 driver. For this situation, the current flowing into the microcontroller must be maintained at less than its maximum specification (see Equations 1 and 2).
  2. The MAX232 outputs a low at the TTL side. For this scenario, R must hold a value that keeps the input voltage of the microcontroller under its VILMAX level (see Equations 3 and 4).
  3. The microcontroller tries to output a high to the RS-232 driver. This case is not a concern, since both R and the 5k internal resistor pull up the input of the RS-232 driver.
  4. The MAX232 tries to output a high to the microcontroller. This is exactly the same as the previous case.

When using a MAX232 line driver and a PIC microcontroller, R needs to be between 263 Ω and 476 Ω. A value of 370 Ω lies in the middle of these two, and thus is a good choice.

Finally, a software consideration must be taken into account: Any data transmitted from the peripheral system to the microcontroller will also be received by the peripheral. This feedback may be used to check data corruption or it simply can be discarded.

Sponsored Recommendations

Near- and Far-Field Measurements

April 16, 2024
In this comprehensive application note, we delve into the methods of measuring the transmission (or reception) pattern, a key determinant of antenna gain, using a vector network...

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.

Empowered by Cutting-Edge Automation Technology: The Sustainable Journey

April 16, 2024
Advanced automation is key to efficient production and is a powerful tool for optimizing infrastructure and processes in terms of sustainability.

Comments

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