Skip to content

Commit

Permalink
moved sbus protocol to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Schlieper committed Sep 21, 2018
1 parent d05e97d commit e1572c4
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,7 @@ Create a new model for the SBus Gamepad on your transmitter. Make sure that you

All testing was done using a Teensy 2.0 and the 16 channel FrSky XM receiver (no other hardware was tested). Shoud you need to adjust the range of the sbus values sent by your transmitter please edit the X1, X2 macros in the SBus.h file and rebuild. The Teensy needs to run with 5 volts to be a full speed USB device. Also the FrSky XM receiver needs the 5 volts to operate (output of the sbus signal is 3.3 volts though). Total power consumption should be around 50 ma at 5 volts (30 ma for the Teensy and 20 ma for the XM receiver).

## SBus Protocol

The sbus protocol is a 100 kilo baud serial protocol (1 start bit, 8 data bits, 1 even parity bit and 2 stop bits). Every 7 milliseconds a packet of 25 bytes get sent by the receiver. The packet is made up of a start byte, 22 data bytes, one flag byte and an end byte:

[start][data1][data2][data3][data4][data5][data6][data7][data8][data9][data10][data11][data12][data13][data14][data15][data16][data17][data18][data19][data20][data21][data22][flags][end]

The start byte is 0x0f and the end byte usually 0x00. Remember these are the values the teensy sees after the sbus protocol 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.

---

10 Sep 2018
Date: 2018-09-21

0 comments on commit e1572c4

Please sign in to comment.