Go Down

Topic: Serial communication between 2 different boards. (Read 1 time) previous topic - next topic


I have pretty well exhausted everything I can to solve this problem.

I have a 9dof Razor and have tried to send data to every other make of Arduino Board there is and never get the proper info coming across.

I use  this line to send the data

Code: [Select]

Using an Ftdi serial cable i can read that data fine on my computer.

I send that same data to any other Arduino capture it and then ask it to print and it is not correct.

Here is the capture and print code.

Code: [Select]

byte headingData[2];
int i, headingValue;
void loop()
//-------------------------------------------- this is all gps stuff. This is just the example code given from tiny gps library.
//----------------------------------------------I deleted the part of the code for the time and date. I did not want it.

headingValue =0;
if (headingValue != 0)

void compassheading(){
   i = 0;
 while(Serial.available() && i < 2)
   headingData[i] = Serial.read();


headingValue = (headingData[0]*256 + headingData[1]);  
headinggps = headingValue / 10;      // this is the heading of the compass


Anyhow am I missing something here?
Probably and i think i know what it is.

I have been using the Arduinos Uarts and am thinking i need to throw a Max232 into the mix.
I certainly hope not.
If so am just going to breakout the SPI on the Razor  and communicate that way.

All I am trying to do at this stage is to read the compass from the razor  and send that heading to another board.


Aug 24, 2010, 02:22 am Last Edit: Aug 24, 2010, 02:24 am by BKnight760 Reason: 1
The data coming across may be converted to ASCII.  So a digit "0" appears as decimal 48.  check out http://www.klcconsulting.net/images/ascii-full.gif

If you're just sending integers, you can just subtract 48 from all the serial.read() results.  

If you're sending more than just integers, you'll need to parse out the data.

To help debug the issue, could you paste the sent data and the actual received values?


If you connect the rasor to a normal pc serial port, can you see the proper output a terminal program like hyperterminal?
Google forum search: Use Google Advanced Search and use Http://forum.arduino.cc/index in the "site or domain:" box.


Thanks for replies .

It is ascii values. Should have checked that :(

As far as the razor working direct to the PC yes it does.

And so does the Arduino boards work properly connected direct to the PC. It only happens when I send data from one device to the other using the serial port that this happens.


As far as the razor working direct to the PC yes it does.

This sounds like the rasor is using standard rs232 communications which would need to be converted to TTL for the arduino to use.
Google forum search: Use Google Advanced Search and use Http://forum.arduino.cc/index in the "site or domain:" box.


Are you trying to use the Serial Monitor to "see" things, at the same time as you are trying to use the Ardunio's serial port to talk with Razor?

I prefer to use a separate port, via NewSoftSerial, to avoid clashes. Even if you aren't using Serial Monitor, the Arduino's main port is "busy" with programming from time to time.

More at...


Don't let the "Delphi" bits put you off... there are general principles implicit in the discussion.


Solved the problem.

Baud Rate at  57,600 between the 2 boards just does not work.

Each board direct  to pc  57,600 works fine

Join the boards together and try using 57600 and it fails.

Dropping baud of both boards to 38,400 solved this problem.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131