Connect with us

How to debug RS232?

Discussion in 'General Electronics Discussion' started by gsg, Dec 2, 2010.

  1. gsg

    gsg

    4
    0
    Jul 8, 2010
    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?
     
  2. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,211
    2,695
    Jan 21, 2010
    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.
     
  3. JimW

    JimW

    59
    5
    Oct 22, 2010
    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
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-