MW 2.2 SBUS functionality broken

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Post Reply
User avatar
Plüschi
Posts: 433
Joined: Thu Feb 21, 2013 6:09 am

MW 2.2 SBUS functionality broken

Post by Plüschi »

Yes, SBUS doesent work any more :(
Same hardware works with 2.1

I guess the new things in serial.ino are messing sbus up.

-ralf-
Posts: 215
Joined: Mon Dec 03, 2012 7:08 pm

Re: MW 2.2 SBUS functionality broken

Post by -ralf- »

I confirm .... posted this bug here with video

viewtopic.php?f=8&t=3212&start=50#p33167

Gimbal
Posts: 146
Joined: Tue Jul 24, 2012 7:14 pm
Location: Sweden

Re: MW 2.2 SBUS functionality broken

Post by Gimbal »

Hi gys, try this and you will fix it

"Gimbal wrote:
Hi, I guess that the new serial is interrupt driven is there any chance to have some kind of priority for the interrupt? ex uart1 for sbus, it's getting out of sync and creates glitches.
I don't have this problem with 2.0


I don't think it's a priority problem.
The sbus pace is much lower than what can be decoded on the serial stream

The problem is more deep: when using a sbus receiver, the MSP serial decoding process is not cancelled on this port.
It should be excluded like it's done with Spektrum receivers.
=> need some code rework.

you can try in serial.ino:
while (SerialAvailable(CURRENTPORT) GPS_COND SPEK_COND) {
=>
while (SerialAvailable(CURRENTPORT) GPS_COND SPEK_COND && CURRENTPORT != 1) {
Alexinparis

Posts: 1238
Joined: Wed Jan 19, 2011 10:07 pm
Top
Re: New Multiwii Serial Protocol
by Gimbal » Tue Jan 15, 2013 9:24 pm

That's it Thank you so very much, sbus is so smooth now with out glitches.

Anders

"if (sbus[24] == 0x0){" need's to be inserted in RX.ino to check stop byte

CODE: SELECT ALL
sbus[sbusIndex++] = val;
if(sbusIndex==25){
sbusIndex=0;
if (sbus[24] == 0x0){**********************************************

bla
bla

}"

User avatar
Plüschi
Posts: 433
Joined: Thu Feb 21, 2013 6:09 am

Re: MW 2.2 SBUS functionality broken

Post by Plüschi »

Love you Gimbal :D

in serial.ino search for:

#if defined(SPEKTRUM) && (UART_NUMBER > 1)
#define SPEK_COND && (SPEK_SERIAL_PORT != CURRENTPORT)
#endif

and simply ADD the sbus part blow so it looks like:

#if defined(SPEKTRUM) && (UART_NUMBER > 1)
#define SPEK_COND && (SPEK_SERIAL_PORT != CURRENTPORT)
#endif
#if defined(SBUS) && (UART_NUMBER > 1)
#define SPEK_COND && (SPEK_SERIAL_PORT != CURRENTPORT)
#endif

Works here :mrgreen:

-ralf-
Posts: 215
Joined: Mon Dec 03, 2012 7:08 pm

Re: MW 2.2 SBUS functionality broken

Post by -ralf- »

I tried the solution from Alexinparis,

works too, thanks :D

-ralf-
Posts: 215
Joined: Mon Dec 03, 2012 7:08 pm

Re: MW 2.2 SBUS functionality broken

Post by -ralf- »

BTW ... when will the solution becomes part of the official MW 2.2 ?

User avatar
Plüschi
Posts: 433
Joined: Thu Feb 21, 2013 6:09 am

Re: MW 2.2 SBUS functionality broken

Post by Plüschi »

For a flexible configuration i propose to make a SBUS_SERIAL_PORT definition, like the SPEK_SERIAL_PORT already is.
To do this myself i lack knowledge of SVN, and there must be someone to agree / accep changes? How is this handled?

Post Reply