Seriral communication between 3pi and dsPIC

Hi,

I am trying to establish a serial communication between dsPIC30f4012 and 3pi robot. I use a MAX232 to convert the transmitted signals to RS232 level. The 3pi robot does not seem to receive any data from MAX232. Am I going wrong somewhere?
The connections between MAX and dsPIC are perfect.
These are the connections I made between MAX232 and 3pi robot:

T1OUT(Pin 14 of MAX232) connected to pin PD0 of 3pi robot.
R1IN(Pin 13 of MAX232) connected to pin PD1 of 3pi robot.

Is there anything that has to be done in addition to these?

I appreciate your help.

Regards,
Harini

Hello,

The 3pi does not support RS-232 serial. You need to use TTL-level, non-inverted serial to communicate with it, since pins PD0 and PD1 are direct connections to the microcontroller. Where did you get the idea that you needed the MAX232 chip? In fact, connecting +/- 9V to those pins could easily damage your 3pi!

In general, I would recommend a direct connection between the two microcontrollers, using resistors in line as a safety precaution. Are they running at the same voltage?

Please note that you also need to connect ground on the two microcontrollers.

-Paul

Hi Paul,

I am powering the dsPIC from the 3pi robot and the grounds are connected. I tried a direct connection between the 2 microcontrollers. I also used 2 resistors connected to the ground for the TX and RX pins.

I am not able to get it to work. I transmit data from the dsPIC at the rate of 9600 baud to the 3pi robot. I configured the serial communication of 3pi robot to run at 9600 baud as well.
Am i going wrong somewhere?

Thanks,
Harini

Hello,

You are clearly going wrong somewhere, since it is not working.

What you should do at this point is

Step 1: verify that you have not already damaged the RX and TX ports on the 3pi or the dsPIC by trying to use them as digital inputs and outputs. Post a description of your tests and the results.

Step 2: connect RX of one board to TX on the other board through a resistor, like this:

RX - resistor - TX

Note: this is NOT a resistor to ground. Something between 100 and 1000 ohms should prevent you from damaging the IO lines if you accidentally connect, for example, TX to TX, without affecting your signal much. Disconnect as many other things as you can (for example, the corresponding TX-RX connection) and simplify your code to the simplest possible thing that should send a byte from board 2 into board 1 and display some message showing that it was received.

Most likely you will discover your problem in the process of simplifying everything. If not, tell us exactly what connections and circuits you are using, post your entire code, and take a picture if you can. Then we can try to figure out what the problem is.

Good luck!
-Paul