Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 7 of 7

Thread: RC Receiver Problem With Teensy 3.2

  1. #1
    Senior Member
    Join Date
    Oct 2017
    Location
    Houston
    Posts
    414

    RC Receiver Problem With Teensy 3.2

    Hoping someone can help me with getting my FlySky FS-T6 receiver working with the Teensy 3.2. I successfully am receiving the four receiver channels using pulseIn, but that takes too much clock time. I can run Paul's PulsePosition example just fine. But when I try to use the PulsePosition example and replace the Pin 9 to Pin 10 wire with channel three (throttle) into Pin 10 I get no signal. The num value (where num = myIn.available() just reads 0).

    Here's the code. Again, in summary:
    1) I can use the pulseIn command to read all four channels, but it's horribly slow.
    2) So I decided to switch to Paul's PulsePosition library. The example (code below) ran fine with Pins 9 and 10 connected.
    3) But when I remove the Pin 9 to Pin 10 wire, and place any of the receiver lines into Pin 10, I get nothing. In fact, num shows as 0, like it's not able to pick up the signal. Unfortunately I do not have a scope.

    #include <Wire.h>
    #include <Servo.h>
    #include <PulsePosition.h>

    PulsePositionOutput myOut;
    PulsePositionInput myIn;

    void setup(){
    Serial.begin(9600);

    myOut.begin(9);
    myIn.begin(10);
    myOut.write(1, 600.0);
    //myOut.write(2, 1500.0);
    //myOut.write(3, 759.24);
    //myOut.write(6, 1234.56);
    }

    int count=0;

    void loop(){

    int i, num;

    num = myIn.available();
    //Serial.println(num);
    if(num>0){
    count = count + 1;
    Serial.print(count);
    Serial.print(" : ");
    for(i=1; i <= num; i++){
    float val = myIn.read(i);
    Serial.print(val);
    Serial.print(" ");
    }
    Serial.println();
    }
    }

    Could it be a signal power level issue, where maybe pulseIn reads a HIGH at a lower voltage? I'm powering the receiver from the Teensy, which is 3.3v not 5v like it would be with an Arduino Uno. Doesn't seem to make sense that puleIn would grab the receiver signal but not PulsePosition. Thanks!!
    Last edited by Don Kelly; 10-06-2017 at 10:41 PM. Reason: added more detail...

  2. #2
    Senior Member
    Join Date
    Sep 2013
    Location
    Hamburg, Germany
    Posts
    891
    Please post the code that is not working (and use code tags around it to make it more readable).

    Are you sure that the receiver works reliably at 3.3 V? Do you have access to a scope to check if the receiver output has sane voltage levels?

  3. #3
    Senior Member
    Join Date
    Oct 2017
    Location
    Houston
    Posts
    414
    Christoph, unfortunately I do not have a scope. I inserted the code above. Thx.

  4. #4
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,087
    try using PulsePositionInput myIn(FALLING);
    and since T3.2 is 5v-tolerant, try powering your receiver at 5v
    Last edited by manitou; 10-06-2017 at 11:37 PM.

  5. #5
    Senior Member
    Join Date
    Oct 2017
    Location
    Houston
    Posts
    414
    manitou, tried FALLING and powering the receiver at 5v. Still no signal being seen by the Teensy. Wondering how others have gotten this to work for quadcopters. Seems like it should be straight-forward.

  6. #6
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,087
    It's been a while since i messed with RC stuff, so I still may have it wrong, but the PuslePosition library is used to read or write a PPM stream, not the output from each of the servo pins on you FlySky FS-T6 receiver. If you had a bunch of joysticks and buttons connected to your teensy you could use the library's PPM out to send the encoded joystick data out the teensy pin to a cable to a flight simulator, or if you had a radio transmitter to an RC plane. If you have a trainer cable for your RC transmitter, you could use the PulsePosition input to read the PPM stream from the trainer cable and perhaps have the teensy control servo motors through Servo pins to affect yaw, pitch, roll, throttle.

    if you really want to read each of the servo pins on your FlySky receiver, you might use attachInterrupt(), see
    http://rcarduino.blogspot.com/2012/0...iver-with.html
    http://www.camelsoftware.com/2015/12...-with-arduino/
    or http://www.instructables.com/id/Rc-C...-Arduino-Proj/
    https://github.com/simondlevy/RXInterrupt
    Last edited by manitou; 10-07-2017 at 10:44 AM.

  7. #7
    Senior Member
    Join Date
    Oct 2017
    Location
    Houston
    Posts
    414
    Manitou, This helps a lot, thx much!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •