skip navigational linksPJRC
Shopping Cart Checkout Shipping Cost Download Website
Home Products Teensy Blog Forum
You are here: 8051 Tools Development Board Troubleshooting Startup Issues

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
Development Board
Code Library
89C2051 Programmer
Other Resources

Startup Issues

Even if your hardware is functioning correctly, the 8051 development board may still fail to respond because of a problem during startup. This page explains the startup process, so you can understand what may be wrong. A list common startup related problems and solutions is also provided.

Understanding the Startup Sequence

The startup sequence is responsible for executing any startup code you may have loaded onto the board, and for configuring the UART with the correct baud rate, so you can communicate using the serial port. An option to erase the flash rom is also provided. Figure 1 shows the steps that are taken during startup.

flowchart: reset, 54 ms delay, if flash erase pin is low, erase flash.  Then execute all 249 starup programs.  If baud rate not in ram, wait for carriage return character.  If char looks like CR, compute baud rate, store into RAM, then configure UART, execute all 253 startup programs and finally, print the welcome message
Figure 1: Startup Sequence Flowchart

The baud rate detection is performed only if no previous record of the baud rate is stored in RAM. Four copies are stored in the 87C52 internal RAM, at locations 0x78, 0x79, 0x7A and 0x7B. If all 4 of these agree, baud rate detection is skipped.

To detect the baud rate, PAULMON2 waits for you to press Enter, where your PC should send a carriage return character (ascii code 13). Elapsed times between bit transitions are measured, and some sanity tests are performed to verify that the byte sampled was likely to be 13. A brief silent time is also required after the byte, except that ascii code 10 (newline) is allowed. These sanity checks make PAULMON2's automatic baud rate detection very resiliant to misdetection of baud rate if the wrong key is pressed. However, in some rare cases, these requirements may not be met and it will continue waiting for what appears to be a valid Enter keypress.

Common Startup Problems

There are several common startup problems. This section attempts to list all known startup related issues, with a description of the symptoms and a solution for each.

Stuck On The Wrong Baud Rate

If baud rate is stored in RAM, the automatic baud rate detection is skipped and the welcome message is immediately sent (assuming no startup programs were present, or they all returned properly).

In this case, the TX LED will flash brightly shortly after the process is reset, and then remain dark. If your PC is set to a similar baud rate, many characters of "garbage" may appear on the screen. Only a single character when the board is powered on can be due to the voltage change as the power comes up, and not necessrily due to actual data transmission at the wrong baud rate. However, if the incorrect baud rate is significantly different that your PC's setting, the PC may ignore all the bytes because they will likely not have valid stop bits. The single bright flash on the TX LED after reset, with no activity on the RX LED, is your best indication that the board has "learned" an incorrect baud rate.

The quick solution is to simply turn off power to the board for several seconds. Usually 5 seconds is long enough for the RAM to "forget". It is ok to leave the serial cable connected when the board is without power.

The most common cause of incorrect baud rates is a Microsoft Windows "plug and play" attempt to initialize a modem. If the board is connected while the PC reboots, and windows attempts to send commands to a modem, those commands may contain the carriage return character which triggers the board to learn the baud rate Windows used for the modem.

Only 115200 Baud Works

This is most like due to your terminal emulator sending newline (ascii 10) instead of carriage return (ascii 13) when you press the Enter key.

Most terminal emulators can be configured to send carriage return (CR, ascii 13), newline (NL, ascii 10), or both (CR/NL, both bytes). Most programs default to CR/NL. Using only CR is ok. If your terminal emulator sends only NL, you should change the setting to transmit CR or CR/NL.

At 115200 baud, PAULMON2's bit transition timing measurement lacks the time resolution to distinguish CR from many other characters, including NL. However, the startup code was carefully designed and tested to "fail" with the correct baud rate in this high speed case. At lower speeds, it continues to wait for the correct CR character before making the baud rate calculation.

Sometimes Starts, Very Noisy Communication

This frustrating problem may appear to be incorrect baud rate. However, the board does wait for you to press Enter, but only sometimes responds. The response is usually many incorrect "garbage" characters, sometimes with short sequences of correct text. Often there is no response at all. Sometimes the board works when you attach an oscilloscope or other piece of test equipment, but not just by itself.

This problem is usually caused by a faulty serial cable, where the ground (pin 5) is not connected. Often times the ground of the power supply for the 8051 board is at a similar potential as your computer's ground, which allows only intermitently correct communication.

Check your serial cable, and also the quality of connections on the 9 pin connector on your board. Also, check that your power supply really is DC voltage (not AC), that it's connections are reliable, and it is at the same ground potential as your computer.

Good CR Character Into RxD Pin, Nothing Out Of TxD Pin

If you have tried all the tests, and you know that the board has good power, the crystal and reset are working, and the receiver signal is good, then the 87C52 chip may be damaged.

All assembled boards shipped by PJRC are fully tested and this chip is known to be good. All unassembled kits are provided with a chip that was pre-programmed and verified. It is possible, but very unlikely the chip from an unassembled kit is bad.

If your 87C52 chip was not purchased from PJRC, the 87C52 may not be correctly programmed with the PAULMON2 code. PJRC provides all of the code for free, but absolutely no technical support is available for using third party equipment to program your own 87C52 chip. Please contact the manufacturer of your EPROM programmer for technical support if your 87C52 was not correctly programmed.

You can order a replacement pre-programmed 87C52 chip from PJRC. These chpis are verified after programming, and all batches qualified by sampling several chips in assembled boards.

8051 Development System Circuit Board, Paul Stoffregen
Last updated: March 4, 2005
Status: finished
Suggestions, comments, criticisms: <>