Single-supply RS-232 transmission without level-translator ICs

May 27, 1997
In general, the best way to reduce the price of cost-sensitive consumer products is to lower chip count as much as possible, leaving more tasks to be performed in software. For example, in applications where RS-232 transmission is used...

In general, the best way to reduce the price of cost-sensitive consumer products is to lower chip count as much as possible, leaving more tasks to be performed in software.

For example, in applications where RS-232 transmission is used (remote data loggers or distributed data acquisition systems that use a microcontroller to report data to a host PC computer through RS-232 interfaces), it’s easy to replace the hardware UART and implement this function in software.

It’s also possible, however,. to replace the IC normally needed to translate TTL voltage levels to RS-232 voltage levels (i.e. replace the MC1488 or MAX232 ICs) by using a very simple software trick, creating a direct link between the microcontroller and the serial port of the host PC computer (Fig. 1).

In accordance with the RS-232 standard, a MARK signal (logic “1”) is a negative voltage between −3 V and 25 V, and a SPACE signal (logic “0”) is a positive voltage in the range from +3 V to +25 V. Therefore, if signals are sent between +5 V and −5 V, they will be detected by standard RS-232 receive circuitry as being valid RS-232 signals.

To get these levels with a microcontroller powered only by 5 V, the voltage applied to the common or reference line must be changed to obtain +5 V or −5 V. That is, to transmit a MARK signal (−5 V), the TxD line must be pulled down to 0 V while the GND line is pulled up to +5 V. In this way, the PC will sense a negative voltage between its RxD and GND pins. Similarly, to transmit a SPACE signal (+5 V), the TxD line up must be pulled up to +5 V and the GND line of the microcontroller pulled down to 0 V so that the receiver (PC serial port) can sample a positive voltage between its RxD and GND pins (Fig. 2).

To test this software trick, an assembly language program listing based on the low-cost, low-end Motorola MC68HC705K1 microcontroller is provided (see the listing). It transmits the sentence: “ELECTRONIC DESIGN MAGAZINE: IDEAS FOR DESIGN” over and over again. In addition, it can be displayed on the screen of the PC using the Windows Terminal program configured for 9600 bits/s with 8 data bits, l stop bit, and no parity bits.

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!