CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Sbus2 library

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
yossihagag1978



Joined: 04 Apr 2013
Posts: 19

View user's profile Send private message

Sbus2 library
PostPosted: Mon Oct 08, 2018 11:03 am     Reply with quote

Is there sbus2 code for futaba ?
Ttelmah



Joined: 11 Mar 2010
Posts: 19513

View user's profile Send private message

PostPosted: Mon Oct 08, 2018 11:16 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Oct 08, 2018 11:27 am     Reply with quote

I am trying to control a servo motor via sbus2.
The link does not help.
Ttelmah



Joined: 11 Mar 2010
Posts: 19513

View user's profile Send private message

PostPosted: Mon Oct 08, 2018 11:38 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Oct 08, 2018 10:02 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Oct 08, 2018 11:29 pm     Reply with quote

I can't see any ability to program stop bits in it's data sheet.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group