Maker Pro
Maker Pro

How to debug RS232?

gsg

Jul 8, 2010
4
Joined
Jul 8, 2010
Messages
4
I'm using RS232 to transmit and receive characters between a dsPIC33 microcontroller and a computer. I'm not getting any output at the computer terminal. I tried to see the received characters on HyperTerminal as well as Flash Magic terminal.
I checked the Rx and TX pins of the microcontroller as well as the DB9 connectors on an oscilloscope. Here I'm getting a proper signal waveform with correct voltage levels(3.3V at microcontroller pin and +12/-12V at DB9). Both end of the serial cable also show correct waveforms.
Yet there is no output at computer terminal.I also sent a character from the computer and wrote a code in the dsPIC33 to glow an LED if the char is received. Yet no output.
Are there any COM port/terminal settings that I'm missing? How do I debug this?
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Silly question, but you haven't done something like wire up both transmit pins together and both receive pins together?

I once had a tester that had a pair of back to back LEDs (actually a red/green LED) and a resistor connected between several pins and ground. It was very useful in determining, for example, that both ends were not trying to transmit on the same line.
 

JimW

Oct 22, 2010
59
Joined
Oct 22, 2010
Messages
59
As Steve said, make sure that the Transmit output from the microcontroller (usually is either at the +12 or -12 rail, pin 2 or pin 3) goes to the receive input of the terminal (usually at some nominal middle voltage). Or use your scope to make sure which pin is your transmit and then look at the output of the terminal to make sure which pin it uses as an output, and make sure you aren't connecting those to each other. No need to start the entire DCE vs DTE debate.

With a beakout box you can look at these signals when the 2 devices are connected and make sure that both directions have signals that transition from -12 to +12.

Other ideas: make sure that you have software flow control only set for the terminal (XON/XOFF) and that it isn't looking at any hardware flow control signals (RTS/CTS, DCD). Verify that your microcontroller is sending at the baud rate that the terminal is looking for. Prove that each piece works by itself using a loop back connection (tie pins 2 and 3 together, type a character on the trminal and see if it is received, do the same on your micro).

-Jim
 
Top