ServoDecode - The decoder is NOT_SYNCHED

Hello,

I am trying to decode a ppm signal from a 2 channel traxxas receiver (model 2015) using code supplied by mem. I have soldered a wire to pin 3 (Clock) of the d type flip flop of the reciever and have this wire connected to pin 8 of my arduino uno. Arduino ground is connected to the receiver ground, yet the serial monitor returns this:

The decoder is NOT_SYNCHED
Cx0= 0  Cx1= 0  Cx2= 0  Cx3= 0  Cx4= 0  Cx5= 0  Cx6= 0  Cx7= 0  Cx8= 0

Here is the link to the code I am using http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1204020386/165, the code is posted at reply 170.

Thanks a lot! Arthur

Do you have an oscilloscope? Did you change the pin assignment?

Sadly no. I have tried measuring the voltage between ground and ppm, and i do get a reading, about compromised between 0.1 and 0.3 volts

I simplify the code to get a better idea of what is coming in on the input. Capture about 40ms worth of transitions, and print out the high and low times A simple voltmeter isn't going to give you meaningful readings.

I know, but it at least proves that there is an input. Will try that, first going to try following this link http://accrochages.drone.ws/en/node/90 and see if i can get any meaningful readings, will post back. Thanks a lot!

Ok, i got the arduino scope working but the readings are really strange. With nothing plugged in, i get readings of around 0 on all 6 analog pins. But, as soon as I plug the receivers ppm signal into any of the pins, the reading reaches 0, it sends the readings on all the other pins fluctuating before they too after a dozen seconds show 0.

I’d write a simple sketch that just stores transition times (low to high or high to low) on a single digital pin in an array of, say 100 “unsigned longs” (watch out for buffer overflow) over a period of 40ms, then print out the results.

(compiled but untested)

const int N_READINGS = 100;
const unsigned long PERIOD = 40000UL;
unsigned long times [N_READINGS];
const int inputPin = 2;
void setup ()
{
  Serial.begin (9600);
  analogWrite (3, 192);  //start off a roughly 75% duty cycle calibration signal
}

void loop ()
{
  int readings = 0;
  int startCondition = digitalRead (inputPin);
  int lastCondition = startCondition;
  unsigned long startTime = micros ();
  while (startTime - micros () < PERIOD) {
    if (digitalRead (inputPin) != lastCondition) {
      times [readings++] = micros ();
      if (readings >= N_READINGS) {
        Serial.println ("OVERFLOW!");
        break;
      }
    }
  }

  int direction = startCondition;
  for (int i = 0; i < readings; ++i) {
    Serial.print (direction ? "hi->lo @ " : "lo->hi @ ");
    Serial.println (times [i]); 
    direction = 1 - direction;
  }
  delay (5000);
}

I uploaded the sketch but am not receiving anything on the serial monitor (nor is the TX light blinking). Unfortuantely I am new to this and don't really understand everything as of yet. I am going to try grabbing the ppm signal from the other clock pin, they should be identical but who knows...

I put a cal signal on pin 3 of the Arduino in the sketch - this should be a 75% duty cycle PWM signal at about 490Hz. (1.53ms high, 0.51ms low) Connect this to the input pin, and see if you get results.

Have you conneccted the grounds?

Sorry, don't have an Arduino handy here.

BIG OOPS!

Missed out a “lastCondition = digitalRead (inputPin);” inside the conditional

while (startTime - micros () < PERIOD) {
    if (digitalRead (inputPin) != lastCondition) {
      lastCondition = digitalRead (inputPin);
      times [readings++] = micros ();
      if (readings >= N_READINGS) {
        Serial.println ("OVERFLOW!");
        break;
      }
    }
  }

Very sorry. (quick and dirty, just a little too dirty)

haha thanks a lot for your help. If I understand correctly this is supposed to measure the time between a low to high and vice versa for a period of one hundred longs and then print the results on the serial monitor? Even with the added lines I'm not getting anything at all.

Even connected to the PWM on pin 3?

If I understand correctly this is supposed to measure the time between a low to high and vice versa for a period of one hundred longs and then print the results on the serial monitor?

No, you don't understand correctly - it is supposed to measure up to 100 transitions in a 40ms period, then print the results, then wait 5 seconds and repeat.

You could add a debug serial print at the very top of "loop" and another just before the results are printed.

oh ok. Sorry I'm still new at this. I'm still not getting any output from your program :( I've tried grabbing the ppm signal from the other clock pin and it does appear to be stronger. If i use arduinoscope inputs from the remote clearly change the signal though the difference between highs and lows is very small. is it possible that the signal is just too weak? I'll try adding in a transistor. Thanks a lot!

If I had another brain-cell, I might just make it to half-wit:while ( micros ()- startTime < PERIOD) {

I'd be glad to donate one :D I'm still not getting anything... maybe its time to get an oscilloscope.

IT WORKS! The receiver was only connected to the arduino with ground and ppm, but upon adding 5v in to the receiver things started working. It only works with the 5v in and with the ppm signal from pin 11 on the flip flop and not pin 3 which is weird as they are both clock pins. Thanks a million for your amazing help AWOL! Arthur

Are you saying that the receiver wasn't powered at all before?

No, I followed several tutorials to get the ppm signal and they all mentioned that the only connections needed were ground and ppm, that a Vin connection should not be necessary…