skip navigational linksPJRC
Shopping Cart Download Website
Home Products Teensy Blog Forum
You are here: 8051 Tools Development Board Troubleshooting Serial Receive

PJRC Store
8051 Board, $79
LCD 128x64 Pixel, $29
LCD 16x2 Char, $14
Serial Cable, $5
9 Volt Power, $6
More Components...
8051 Tools
Main Page
Software
PAULMON Monitor
Development Board
Code Library
89C2051 Programmer
Other Resources

Serial Port Receiver Test

These tests are used to troubleshoot reception of serial port signals, from the 9 pin connector to the RxD pin on the 87C52 processor. When power is applied to a new board, the PAULMON2 monitor waits for you to send the carriage return character (press the Enter key), which it uses to automatically detect the baud rate your computer is using. Only after baud rate detect can it send you the welcome message. So the correct delivery of your serial port signal is necessary to get the board to respond.

Figure 1 shows a simplified schematic of the path your serial port signal follows, from the 9 pin connector, through the MAX232 tranceiver chip, through two 74HC02 NOR gates, and finally to the RxD pin on the 87C52 chip. All of these tests refer to this schematic, so you may find troubleshooting easier if you print this schematic for reference.

simplified schematic diagram
Figure 1: Receive Signal Path

DC Voltages With No Cable Connected

The first and easist test is to simply measure the DC voltages at each point from the connector to the 87C52 chip, which no cable connected. You should see these voltages:

VoltageDB9, Pin 3HC02, Pin 2 HC02, Pin 1287C52, RxD
DC 0 to 0.2   5   0   5  

The serial port connector and 87C52 pins can only be measured from the bottom side of the board. Figures 2 and 3 show how to measure these. Pins on the 74HC02 and MAX232 chip can be measured from either side. When measuring from the bottom, remember that the order is reversed. Pin 1 is indicated by a square solder pad to help you correctly identify the pins.

photo: multimeters leads on serial port pin 3 and ground
Figure 2: Measure Voltage on Serial Port Pin 3

DC Voltages With Cable Connected, No Data Flow

When the PC is connected by the serial cable, but the PC is not transmitting any data, you should see a significant negative voltage at the connector. The other voltages should be the same as before.

VoltageDB9, Pin 3HC02, Pin 2 HC02, Pin 1287C52, RxD
DC -13 to -5   5   0   5  

The exact voltage will depend on the PC. Most desktop PCs transmit between -10 to -11.5 volts. Many laptops use lower power chips and lower voltages. Even as little as -3 volts is acceptable, but if the PC is connected and uses rs-232 compliant signal levels, you should see a negative voltage that is significantly different than the nearly zero volts when the cable was not connected.

If you do not see the negative voltage from your PC, the most likely problem is a "null modem" cable wiring, rather than the standard cable. You can disconnect the cable and using your multimeter ohms or continuity test to check if pin 3 on one side really connects to pin 3 on the other side. In a null modem cable, the wires for pins 2 and 3 are swapped.

photo: multimeters leads on RxD pin and ground
Figure 3: Measure Voltage on 87C52 RxD Pin

DC Voltages With +5 Volts On Pin 3

In this test, you must disconnect the cable and apply +5 volts directly to pin 3. This will simulate the brief times when data are transmitted, but the voltage is a steady DC signal that is easy to measure.

Warning: The board may be permanently damaged if you accidentally touch a wire connected to +5 volts to the wrong location. Please be sure the +5 volt wire is securely connected to pin 3 before using your hands to manipulate the multimeter leads. DO NOT attempt to hold a wire on pin 3 and +5 volts while also manipulating the multimeter leads!

When +5 volts is connected to pin 3 on the serial port, all the other voltages should change, and the red "RX" LED should illuminate brightly.

VoltageDB9, Pin 3HC02, Pin 2 HC02, Pin 1287C52, RxD
DC 5   0   5   0  

If this test and the previous two all passed, then your serial port receive circuitry is almost certainly working. However, it is possible to test with live data.

AC and DC Voltages With Repetitive Data Input

In this test, you will reconnect the board to your PC and cause the PC to transmit a steady stream of bytes. This results in observable signal activity on all the lines.

First, configure your keyboard's auto-repeat feature to transmit 30 characters per second when a key is held down. On many computers, this is set in the bios configuration during startup. You may also be able to set this using a kayboard control panel from your operating system. Slow auto repeat speeds may be used, but they will result in smaller voltage changes.

Next, open your terminal emulation program and configure the baud rate for 1200 baud. This slow baud rate results in longer pulses for each byte, which is easier to measure. Hold the space bar down. You may need to use tape or rest an object on the keyboard to keep the space bar pressed while you measure the voltages. Other keys may be used, but the space bar is easiest to keep held down, and the space character contains many zeros, which results in an easier signal to observe.

The red "RX" LED should blink rapidly, with a visual appearance of nearly constant illumination with many brief dark moments per second.

Using a standard desktop PC that transmits -10.27 volts in the no data test above, the following voltages should be seen during a stream of 30 space characters per second at 1200 baud:

VoltageDB9, Pin 3HC02, Pin 2 HC02, Pin 1287C52, RxD
DC -6.07   3.99   1.01   3.99  
AC 8.38   1.98   1.98   1.98  

The voltages at pin 3 on the serial port may appear different if your PC uses different RS-232 driver chips. Laptops using reduced voltage levels may result in much lower measurements. The voltages on the internal signals should be similar.

These 1.98 volt AC signals are expected values using a "true RMS" AC multimeter. Inexpensive meters have a simple averaging circuit which is calibrated for accurate AC measurements only for sine waves. Even though the numbers may be very different without a true RMS meter, you should still see a significant AC voltage when the PC transmits a stream of 30 space characters per second, and nearly 0 volts AC when no data is present.

If you can cause the PC to start and stop transmitting while maintaining the voltage measurement (leads secured, or 3 hands), the presence and absence of data flow should be very easy to observe using your voltmeter. That's a very strong confirmation that the serial data from your PC is truely reaching the RxD pin on the 87C52.


8051 Development System Circuit Board, Paul Stoffregen
http://www.pjrc.com/tech/8051/board5/serial_recv_check.html
Last updated: February 25, 2005
Status: finished
Suggestions, comments, criticisms: <paul@pjrc.com>