View previous topic :: View next topic |
Author |
Message |
yossihagag1978
Joined: 04 Apr 2013 Posts: 19
|
Sbus2 library |
Posted: Mon Oct 08, 2018 11:03 am |
|
|
Is there sbus2 code for futaba ? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19513
|
|
Posted: Mon Oct 08, 2018 11:16 am |
|
|
Have a look here:
<http://sbustelemetrysensors.blogspot.com/>
The poster here is working on decoding the sbus2 protocol using CCS.
Problem is Sbus, is _proprietary_. Futaba do not release it's details, and don't want other people to write code to use it.
It has at least partially been 'cracked' so people like this do have some code, but it is going to depend on what you actually want to do with it.
Remember you are going to need a low voltage PIC (it runs at 3.6v).
The basic data transmission is standard serial (but inverted). One start bit, eight data bits, one parity, 2 stop bits. 25 byte packet sent every 14mSec or 7mSec (high speed mode). 100000bps. 0xF0 as a start byte, 0x00 as a stop byte. Channel data is eleven bits at a time, split across the bytes. It is sent bi-directionally on a single wire using 'open collector' driving.
Last edited by Ttelmah on Mon Oct 08, 2018 11:28 am; edited 1 time in total |
|
|
yossihagag1978
Joined: 04 Apr 2013 Posts: 19
|
|
Posted: Mon Oct 08, 2018 11:27 am |
|
|
I am trying to control a servo motor via sbus2.
The link does not help. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19513
|
|
Posted: Mon Oct 08, 2018 11:38 am |
|
|
It does actually. If you track through it there is a lot of stuff.
However the bus is not going to be easy to drive. You either need a PIC24 (which supports inverted serial), or to add an inverter.
What channel is the servo going to be on?.
The format has the start byte sent, then 22bytes, carrying the data for 16 channels. 16*11 = 176 bits. 22*8 = 176 bits.
Then the 23rd byte is a 'status' byte. Two digital bits, frame lost, and failsafe. Then the stop byte.
So with the right signaling hardware to give the voltage levels, to send a value to channel 0, you only need standard #USE RS232 at 100000bps, and send the start the data for the low 8 bits, then the data for the high 3 bits, & zeros for the rest.
There is an issue that the PIC (16/18) can't send two stop bits, but this can be programmed around by adding an extra bit time delay between the bytes. |
|
|
garyatpt
Joined: 01 Oct 2018 Posts: 8
|
|
Posted: Mon Oct 08, 2018 10:02 pm |
|
|
Hi,
Maybe PIC18(L)FxxK42 is a good choice.
The UART module includes the following capabilities:
*Programmable 1, 1.5, and 2 Stop bits
*Programmable data polarity
*.... |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19513
|
|
Posted: Mon Oct 08, 2018 11:29 pm |
|
|
I can't see any ability to program stop bits in it's data sheet. |
|
|
|