RC Receiver Problem With Teensy 3.2

Status
Not open for further replies.

Don Kelly

Well-known member
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:
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?
 
try using PulsePositionInput myIn(FALLING);
and since T3.2 is 5v-tolerant, try powering your receiver at 5v
 
Last edited:
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.
 
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/01/how-to-read-rc-receiver-with.html
http://www.camelsoftware.com/2015/12/25/reading-pwm-signals-from-an-rc-receiver-with-arduino/
or http://www.instructables.com/id/Rc-Controller-for-Better-Control-Over-Arduino-Proj/
https://github.com/simondlevy/RXInterrupt
 
Last edited:
Status
Not open for further replies.
Back
Top