Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to debug RS232 communication?

Status
Not open for further replies.

gsg

Junior Member level 1
Joined
Feb 23, 2010
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,434
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?
 

first u check whether ur serial cable is working or not.....
connect 2 and 3 rd pin of the RS232,and check the output on the hyper terminal whether whatever data u r writting is displaying or not
 

Check the bit time with a scope, this is a common problem, it must be the same on the terminal and uC and make sure you're not using hardware flow control in the terminal.
 

@pisoiu: I checked both waveforms on the scope. The bit timings are very different. How can they be set??
 

Hi friend

In your description, you have no mention MAX232 IC,
Without this MAX232 IC or other IC, Direct RS232 communication between PC and Microcontroller is impossible.
Check this.
Check your baud rate for communication.It must be same at both end.

Hope this is help you
Shyam
 
Last edited:

I have the MAX232 in place. I'm quite sure that isnt the problem. When I set the same baud rate at both ends there's no output.
But when I kept Baud rate at computer end low and that at PIC end very high, I get some incorrect output (mostly garbage values)
 

Both ends:

baud rate

start bits

stop bits

handshaking

physical connection

Terminal protocol

jack
 

I am not familiar with PIC mcu, I only work with 8051. However, the mechanisms for generating baud rate should be similar. Check the timer or baud rate generator used for this purpose, check to see if the oscillator is properly set, etc. For the Silabs MCU I use, there is a windows tool for configuration, I tell the baud rate required, and it gives me the values to be loaded into registers.
 

Hi friend
when I kept Baud rate at computer end low and that at PIC end very high, I get some incorrect output (mostly garbage values)

For proper communication, Baud rate must be same at both end,
It is require condition.

I think, your calculation for baud rate at Microcontroller side is wrong,
Check your calculation second time by you and with other person.
It is easy way to find out fault.

Hope this is help you,
Shyam
 

first u check whether ur serial cable is working or not.....
connect 2 and 3 rd pin of the RS232,and check the output on the hyper terminal whether whatever data u r writting is displaying or not

Yes of cause, verify this first, loop back Rx and Tx pin and then check the echo from both systems and also check your common grounds
 

and how can we know if the max232 is broken or not. I'm sorry to interupt, but currently i make the similar PCB, and my pcb can't communicate whether i use hyperterminal or VB program, i already check my serial cable, and for the pin i use, at least, ot stoll connected properly. i also have already chech the wiring on my pcb and it's connected fine. i use 5 1uF capacitor, 1 for bypass. so can any of you tell how can we make sure that the ic (max232) is broken or not.
 

and how can we know if the max232 is broken or not. I'm sorry to interupt, but currently i make the similar PCB, and my pcb can't communicate whether i use hyperterminal or VB program, i already check my serial cable, and for the pin i use, at least, ot stoll connected properly. i also have already chech the wiring on my pcb and it's connected fine. i use 5 1uF capacitor, 1 for bypass. so can any of you tell how can we make sure that the ic (max232) is broken or not.

Change it.
or Oscilloscope.
(preferably NOT in that order)

jack
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top