Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Schlieper committed Sep 22, 2018
1 parent da92850 commit 3d4fbe8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SBus Gamepad

## Description
This is software for a USB dongle to use a FrSky Taranis wirelessly with PC simulators like [FPVFreerider](https://fpv-freerider.itch.io/) or [RC-Airsim](http://www.fabricated-reality.com/). On the USB side there is a Teensy 2.0 with an eight bit atmega32u4 CPU. And the receiver is a FrSky XM with sbus output. The Teensy reads the sbus signal of the receiver via UART and then presents that data as a USB HID gamepad to the computer. To read the sbus signal the Teensy needs an inverter in form of a simple transistor. Please see the docs directory for more details.
Ever wanted to use a FrSky Taranis wirelessly with PC simulators like [FPVFreerider](https://fpv-freerider.itch.io/) or [RC-Airsim](http://www.fabricated-reality.com/)? This project will help you do so. The idea was to use a Teensy 2.0 USB controller and pair it with a FrSky XM receiver. The Teensy on one side will provide a USB HID gamepad to the host computer while on the other it will read the sbus protocol of the receiver using the **U**niversal **A**synchronous **R**eceiver **T**ransmitter (UART). To read the sbus signal an inverter in form of a simple transistor will be needed between the Teensy and the receiver. For more details please see the docs directory.

## Hardware
* Teensy 2.0
Expand All @@ -22,14 +22,14 @@ This is software for a USB dongle to use a FrSky Taranis wirelessly with PC simu
* clone or download the firmware
* edit the Makefile and change the LUFA_PATH to where ever you installed LUFA
* make sure the avr-gcc and teensy_loader_cli are in your path
* execute `make` to build the HEX file
* execute `make` to build the hex file
* press and release the tiny Teensy pushbutton to activate the HalfKey bootloader
* execute `make teensy` to download the HEX file to the attached Teensy
* execute `make teensy` to download the hex file to the attached Teensy

If you don't want to build the software yourself just download the Gamepad.hex.save file and load it to the Teensy 2.0 using: `teensy_loader_cli --mcu=atmega32u4 -w -v Gamepad.hex.save`
If you don't want to build the software yourself just download the Gamepad.hex.save file and load it onto the Teensy using: `teensy_loader_cli --mcu=atmega32u4 -w -v Gamepad.hex.save`

## Usage
Create a new model for the sbus gamepad on your transmitter. Make sure that you enable at least 4 channels (e.g ailerons, elevator, throttle and rudder) for the receiver. Bind the receiver like you normally would. Use software like [HTML5 Gamepad Tester](http://html5gamepad.com/) to test the sbus gamepad. Once you have confirmed operation start your favorite simulator and see if it recognizes the sbus gamepad.
Create a new model for the sbus gamepad on your transmitter. Make sure that you enable at least 4 channels (e.g. ailerons, elevator, throttle and rudder) for the receiver. Bind the receiver like you normally would. Use software like [HTML5 Gamepad Tester](http://html5gamepad.com/) to test the sbus gamepad. Once you have confirmed operation start your favorite simulator and see if it recognizes the sbus gamepad.

Date: 2018-09-21

2 changes: 1 addition & 1 deletion docs/SBus.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The sbus protocol is a 100 kilo baud serial protocol (1 start bit, 8 data bits,

The start byte is 0x0f and the end byte usually 0x00. Remember these are the values the Teensy sees after the sbus signal has been inverted by the transistor. The Teensys UART needs the inverter to recognize the start bit (low), partity bit and stop bits (high).

Inside the 22 data bytes the 16 rc channels are encoded. Each rc channel is made up of 11 bits (a value between 0 and 2047). Because of this a rc channel value is spread over 2-3 data bytes. Channel 1 e.g. can be found in [data1] and the next 3 bits of [data2]. Please see the code for details.
Inside the 22 data bytes the 16 rc channels are encoded. Each channel is made up of 11 bits (a value between 0 and 2047). Because of this a channel value is spread over 2-3 data bytes. Channel 1 e.g. can be found in [data1] and the next 3 bits of [data2]. Please see the code for details.

Date: 2018-09-21

4 changes: 2 additions & 2 deletions docs/USB.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# USB Protocol

The Teensy presents itself as a Generic Desktop **H**uman **I**nterface **D**evice (HID) to the host computer. It has one configuration that transfers data to the host computer via an Interrupt IN pipe. All data is contained in 9 bytes described by the configuration report descriptor:
The Teensy presents itself as a Generic Desktop **H**uman **I**nterface **D**evice (HID) to the host computer. It has one configuration that transfers data to the host computer via an Interrupt IN pipe. All data is contained in 9 bytes described by the following configuration report descriptor:

* Collection (Application)
* Usage (Pointer)
Expand Down Expand Up @@ -29,4 +29,4 @@ The Teensy presents itself as a Generic Desktop **H**uman **I**nterface **D**evi
* Input (Data, Variable, Absolute, No Wrap, Linear, Preferred State, No Null Position, Bitfield)
* End Collection

The first 8 bytes contain the first 8 channels the receiver sends. The channel values of 0 to 2047 are converted to a USB friendly signed byte (-127 to 127). The next 8 channels get encoded into 1 byte as buttons that are either "on" or "off" (one bit equals one button). If the converted channel value is greater than zero the button is "on" (1) and otherwise "off" (0).
The first 8 bytes contain the first 8 channels the receiver sends. The channel values of 0 to 2047 are converted to a USB friendly signed byte -127 to 127. The next 8 channels get encoded into 1 byte as buttons that are either "on" or "off" (one bit equals one button). If the converted channel value is greater than zero the button is "on" (1) and otherwise "off" (0).

0 comments on commit 3d4fbe8

Please sign in to comment.