Re: SBUS decoder, display, and wireless buddy box project
Posted: 07 Feb 2021, 02:39
It is possible to change with solder jumpers on the back.
Radio control in its simplest form. Once for right, twice for left!
https://mode-zero.uk/
My sh1106 and ssd1306 showed both ADDR 0x3C running an I2C scanner.
Code: Select all
#define SH1106
// #define SSD1306
// #define DS12864
// #define DS160120
What nice little Oszi you have got? Is it self made or can I purchase it? And if so, where?Martin wrote: ↑22 Jun 2020, 13:13
Long-winded explanation below. Probably better to watch the (long-winded) YouTube video.
SBUS (or S-BUS) is a serial protocol invented by Futaba, but now supported by many R/C manufacturers. It transmits 16 normal channels, plus 2 'digital' channels (single bit, so like an on/off switch) and two bits of data for 'frame lost' and 'failsafe'.
The serial protocol is 100 kbaud, 8 data bits, even parity bit, 2 stop bits. The signal is the opposite polarity to the normal serial signals used by Arduinos and similar. A single frame of data occupies 25 bytes, and takes exactly 3 milliseconds to transmit. With most R/C systems, there are gaps between the frames, and a typical frame rate might be every 11 milliseconds, or whatever.
I wanted to decode SBUS to use a tiny Futaba compatible receiver as part of a wireless buddy box system.
I spent a long time writing a decoder that uses pinchange interrupts to detect the incoming SBUS signal. It worked but suffered from occasional parity or framing errors because the edges need to be timed accurate to 5 microseconds, and with standard Arduino code on a standard 16MHz Arduino, that can't be obtained completely reliably. The chip itself is capable, but the Arduino overhead running the millis() timer and so on means that sometimes a few microseconds of jitter cause problems. I got the program working 100% reliably using Atmel Studio instead of the Arduino IDE, but most people won't want to do that...
So I fell back on using the Arduino's serial "hardware" to receive the signal - that works perfectly, but does mean that the SBUS signal has to be inverted (using a single transistor and two resistors) to be compatible with the Arduino Rx (D0) input.
More details, circuit, sketch etc. to follow... watch this space!
The only problem with that scope is they're only 200KHz and one of my friends bought one and was a bit disappointed. I briefly tried it and it had trouble in measuring a 100K baud serial and can only display ppm with a 5uS resolution (only accurate to the nearest 10uS, even though the advert pictures show mS to 3 decimal places which infer 1uS resolution). He finished with one of these in his flight-box which is slightly more suitable for R/C work: