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

Highly Integrated 20A Digital Power Module for High Current Applications

March 20, 2024
Renesas latest power module delivers the highest efficiency (up to 94% peak) and fast time-to-market solution in an extremely small footprint. The RRM12120 is ideal for space...

Empowering Innovation: Your Power Partner for Tomorrow's Challenges

March 20, 2024
Discover how innovation, quality, and reliability are embedded into every aspect of Renesas' power products.

Article: Meeting the challenges of power conversion in e-bikes

March 18, 2024
Managing electrical noise in a compact and lightweight vehicle is a perpetual obstacle

Power modules provide high-efficiency conversion between 400V and 800V systems for electric vehicles

March 18, 2024
Porsche, Hyundai and GMC all are converting 400 – 800V today in very different ways. Learn more about how power modules stack up to these discrete designs.

Comments

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