Pages: [1] 2   Go Down
Author Topic: ServoDecode - The decoder is NOT_SYNCHED  (Read 881 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:

Code:
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
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 290
Posts: 25813
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Do you have an oscilloscope?
Did you change the pin assignment?
« Last Edit: June 23, 2011, 05:19:19 am by AWOL » Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 290
Posts: 25813
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 290
Posts: 25813
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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)
Code:
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);
}
« Last Edit: June 23, 2011, 06:43:15 am by AWOL » Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 290
Posts: 25813
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: June 23, 2011, 07:02:57 am by AWOL » Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 290
Posts: 25813
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

BIG OOPS!

Missed out a "lastCondition = digitalRead (inputPin);" inside the conditional
Code:
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)
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 290
Posts: 25813
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Even connected to the PWM on pin 3?

Quote
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.
« Last Edit: June 23, 2011, 07:39:00 am by AWOL » Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

oh ok.
Sorry I'm still new at this.
I'm still not getting any output from your program smiley-sad
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!
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 290
Posts: 25813
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'd be glad to donate one smiley-grin
I'm still not getting anything... maybe its time to get an oscilloscope.
Logged

Pages: [1] 2   Go Up
Jump to: