Shop OBEX P1 Docs P2 Docs Learn Events
propeller to arduino serial communication — Parallax Forums

propeller to arduino serial communication

So i've done some searching, but not running across anything useful(for me)
http://forums.parallax.com/discussion/159939/wanting-to-pass-info-from-arduino-to-prop
is an example

basically it's SEEMING like it's
arduino tx -> 3.9k+ res -> chosen rx port on PAB
arduino rx -> chosen tx port on PAB
ground to ground

make sure the speeds are the same and go for it!

what I'm seeing however is that the arduino "hears" the PAB, but the PAB is getting garbage back from the arduino.
on the PAB side I am using code that is known to be able to chat with another propeller board

long version available from the creators repo
https://github.com/chrisl8/ArloBot/blob/master/Propeller C Code for ArloBot/ROS Interface for ArloBot.c
short version
propterm = fdserial_open(QUICKSTART_RX_PIN, QUICKSTART_TX_PIN, 0, 115200);
while (1) {
        pause(10);
        dprint(propterm, "i");
        if (fdserial_rxReady(propterm) != 0) {
            count = 0;
            while (count < bufferLength) {
                buf[count] = readChar(propterm);
                if (buf[count] == '.') 
                    break;
                count++;
            }
             if (buf[0] != 'p' && buf[0] != 'i')
               dprint(term, "%c\n", buf[0]); 
}

duino code:
full available at my github here: https://github.com/chronoglass/arlo-arduino-sensor_board/blob/master/ArlobotSensors-0.3.ino
setup : Serial.begin(115200);
retVal = retValFormat1+i+retValFormat2+pcm+retValFormat3;
Serial.print(retVal);

retVal is a string
each of the formats are strings
i is an int
pcm is an int

anyone have any guesses on what i might be checking?
I'll be searching for any line noise in the time being, haha

Comments

  • looks like i took too long to realize i should lower the speed.

    halving the speed seems to make everything great.. must be noise, or the duino having an issue with the speed.
  • I think all Arduinos (by default) use soft serial communication (bit banging, like the Propeller). If you're using the Uno, which runs 16 MHz, it would be hard to bit bang 115,200, which may be the reason for the trouble.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-10-08 18:05
    Whenever asynchronous serial seems corrupted, slowing down is the second thing to check after a loop-back test of each device.

    It gets much easier to run down problems if you have a good series of test proceedures.

    1. Test a loop back of each device.
    2. Test a loop back that includes the cable.
    3. If failures have not been located, try a slower baud rate until you get one that works well.
  • just a follow on to this, it was pretty stable at 57600 using pins 0 and 1.

    then on a whim i decided to use the software serial library, rather than letting hardware handle it, and moving over to pins 10 and 11 I can reliably get 115200 now.. the rest of the circuit remained the same.

Sign In or Register to comment.