Demand Peripherals     Robotics and Automation Made Easy

RCRX: Radio Control Decoder

The RCRX peripheral reads and decodes the output of an analog RC receiver such as that in the "VEX 75 MHz Control System".

 

Hardware:

The output of the RC receiver should be connected to the lowest numbered input on a GPIO card. The next GPIO pin is driven high to indicate reception of valid RC data. This pin normally is tied to an LED through a 180 Ohm resistor.

The remaining two pins on the connector are general purpose I/O pins.

The RCRX peripheral is often paired with either the GPIO4 card or the GPIO4-ST card. More information about the GPIO cards can be found here cards/gpio4.html and here cards/gpio4-st.html.

 

Resources:

The device interfaces for the RC Decoder include the number or RC channels to expect, the output of the RC decoder as well as the direction and current value of the GPIO pins.

nchan : number of RC channels to expect in input.
This resource tells the peripherals how many channels to expect in the input signal. Setting this accurately helps lower the latency of the channel reading. This resource take a single ASCII digit in the range of two to eight and terminated by a newline.

rcdata : decoded RC signal.
The rcdec resource has the decoded RC signal as string of space separated channel times given in nanoseconds and terminated by a newline. Normally a new reading is available every 20 milliseconds. Output is suppressed if the input signal does not contain a valid RC frame. This resource only works with dpcat.

gpiodir : GPIO direction flags.
The gpiodir resource has the direction of the two GPIO pins as a single numeric digit followed by a newline. A value of 0 make both lines an input and a value of 3 makes both lines an output. A value of 2 make the lower numbered GPIO pin an output and a value of 1 makes the higher numbered pin an output.

gpioval : the value on the GPIO pins.
Use dpset to write to this resource to set an output and use dpget to read from it to get the current value on the pins. A read requires a round trip over the USB-serial link and may take a few milliseconds. This resource works with dpget and dpset but not with dpcat.

 

Examples:

The Vex RC transmitter and receiver have eight channels. Set up RCRX to receive RC data from the Vex transmitter.

    dpset rcrx nchan 8
    dpget rcrx rcdec

A sample output from rcdata might be:

 4923  9303  5065 12165  4869 10471  4838 10871  4744 10447  4761 13445 1
 5074  9282  4873 12306  4873 10513  5085 10586  4784 10362  4874 13378 1
 4856  9390  4946 12121  5024 10465  4831 10823  4828 10407  4744 13472 1
 4967  9327  4926 12295  4896 10415  5039 10667  4790 10387  4761 13515 1
 4926  9334  4924 12117  5025 10457  4752 10942  4808 10285  4846 13488 1

 

FPGA Defined Peripherals
User Interface
FPGA Configuration
FPGA Buttons & LEDs
Host Tx/Rx Interface
AVR Interface
Stereo Audio Amplifier
Text LCD and Keypad
Quad WS2812 Interface
Quad Slide Pot
IR Recv/Xmit
6 Digit LCD
RC Decoder
Keyfob RF Decoder
Rotary Encoder Interface
Quad Touch Interface
Motion Control
Dual DC Motor Controller
Dual Quadrature Decoder
Quad 13 Bit Servo
Bipolar Stepper Controller
Unipolar Stepper Controller
Simple Input / Output
Quad Binary Output
Quad Binary Input
Quad GPIO
Octal Input/Output
32 Channel Binary Output
32 Channel Binary Input
Quad Serial Output
Octal Serial Output
Sensors
Octal 12-bit ADC
Quad Ping))) Interface
Pololu QTR Interface
Octal SRF04 Interface
Instrumentation
Generic I2C
Generic SPI
Octal 8-Bit DAC
Quad Digital Potentiometer
Quad PWM Output
Quad PWM Input
Quad Event Counter
Real Time Clock
Dual Pulse Generator
  

Interface Cards
Control Cards
FPGA Card
MEGA88 AVR Card
User Interface
Stereo Audio Amplifier
IR Recv/xmit
Six Digit LCD Display
Keyfob RF Receiver
Rotary Encoder
Quad Switch Card
Text LCD / keypad
Quad Slide Pot
Quad Touch Interface
Motion Control
Dual 7-amp H-bridge
Quad Open Drain Driver
Quad 10 Amp Relay Card
Input / Output
Octal 8-Bit DAC
Quad Digital Potentiometer
Octal 12-bit ADC
Octal SRF04
Quad GPIO
I2C Prototyping
SPI Prototyping
USB 2.0 Hub
Real Time Clock
Octal Input/Output
32 Channel Input
32 Channel Output
Accessories
Power Distribution Card
15 Amp Power Distribution
5 Volt Switching Regulator
ATX Power Break-Out Card
Disk Drive Power Break-Out
MP43 Aluminum Mounting Plate
WW4 Large Prototyping Card
WW2 Prototyping Card
WW1 Small Prototyping Card
SMP SMD Prototyping Card