SBUS decoder, display, and wireless buddy box project

Any old or new electronic projects on the go
bluejets
Posts: 316
Joined: 19 Jun 2019, 04:09

Re: SBUS decoder, display, and wireless buddy box project

Post by bluejets »

It is possible to change with solder jumpers on the back.
User avatar
kalle123
Posts: 35
Joined: 02 Feb 2021, 07:06

Re: SBUS decoder, display, and wireless buddy box project

Post by kalle123 »

bluejets wrote: 07 Feb 2021, 02:39 It is possible to change with solder jumpers on the back.
My sh1106 and ssd1306 showed both ADDR 0x3C running an I2C scanner.

But the hardware is different.

Have a look here https://forum.arduino.cc/index.php?topic=256374.0

br KH
bluejets
Posts: 316
Joined: 19 Jun 2019, 04:09

Re: SBUS decoder, display, and wireless buddy box project

Post by bluejets »

Example...
Attachments
AddressSelect.jpg
User avatar
kalle123
Posts: 35
Joined: 02 Feb 2021, 07:06

Re: SBUS decoder, display, and wireless buddy box project

Post by kalle123 »

I know :)

Image

Both are 0.96" OLEDs. Both have I2C connection. Both show ADDR 0x3C.
But how to say, this one is a sh1106 and that one a ssd1306?

cu KH
Martin
Posts: 744
Joined: 16 Feb 2018, 14:11
Location: Warwickshire

Re: SBUS decoder, display, and wireless buddy box project

Post by Martin »

Easiest way is to just edit the config.h file, recompile and upload and see if it works. When you have the wrong display driver enabled, you either get a blank display or a display full of fast-changing 'snow'. The 1106 driver is most often used for the 1.3-inch displays, and the 1396 driver for the 0.96-inch ones, but there may be exceptions.

You won't damage the displays or the Arduino by selecting the wrong driver.

In config.h you'll see the different driver types listed near the top, and you comment out (using // ) all the lines except the one you want.

Code: Select all

#define SH1106
// #define SSD1306
// #define DS12864
// #define DS160120
A bit further down in config.h the default addresses for each display type are defined. If you want to use a different address, just edit the address for whichever display type you have enabled.

Another thing to watch out for with OLED displays, is that the four pins aren't always in the same order. You can get two displays that appear almost identical, but the VCC, GND, SDA, and SCL pins are shuffled around. It's very annoying when you've laid out a PCB to put the pins in the 'correct' order for a display, only to find that for the next batch of displays you buy, it's now the 'wrong' order. :? Of course, if you're wiring to the displays with individual wires, it doesn't really matter, so long as you're careful to note which pin is which.
User avatar
kalle123
Posts: 35
Joined: 02 Feb 2021, 07:06

Re: SBUS decoder, display, and wireless buddy box project

Post by kalle123 »

My fault was, thinking that the I2C ADDR is linked to a specific type....

Found out, that my thinking was wrong ;)

br KH
Herbertflieger
Posts: 1
Joined: 26 Jun 2021, 08:49

Re: SBUS decoder, display, and wireless buddy box project

Post by Herbertflieger »

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!
What nice little Oszi you have got? Is it self made or can I purchase it? And if so, where?
Martin
Posts: 744
Joined: 16 Feb 2018, 14:11
Location: Warwickshire

Re: SBUS decoder, display, and wireless buddy box project

Post by Martin »

It's my PPM decoder. There's a thread about it, and details on how to build one here: viewtopic.php?f=41&t=612

It's not really an oscilloscope. The 'oscilloscope-like' display only works for PPM signals - you can't use it to display, for example, audio signals.
bluejets
Posts: 316
Joined: 19 Jun 2019, 04:09

Re: SBUS decoder, display, and wireless buddy box project

Post by bluejets »

There are these available though........
https://www.ebay.com.au/itm/19385026045 ... tupt=true
DSO_Scope.jpg
User avatar
Mike_K
Posts: 669
Joined: 16 Feb 2018, 06:35
Location: Hertfordshire

Re: SBUS decoder, display, and wireless buddy box project

Post by Mike_K »

bluejets wrote: 28 Jun 2021, 00:02 There are these available though........

DSO_Scope.jpg
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:

https://www.ebay.co.uk/itm/384187706880 ... SwanFcrdtk

Mike
Post Reply