sbus control of pins
sbus control of pins
I'm trying to set up an sbus receiver (OrangeRX DSMX3, 3 normal channels, 1 14 channel sbus output) to also handle things like a video switcher (uses pwm signals to determine camera 1, 2 or 3 for high/mid/low), and camera gimbal pitch (setting gimbal to point downwards, angled or straight forward).
Is it possible to define a pin on the atmega 2560 (in my case a Crius AIOP 1.1) to basically pass on the channel data as if those pins were a standard receiver pwm output?
Is it possible to define a pin on the atmega 2560 (in my case a Crius AIOP 1.1) to basically pass on the channel data as if those pins were a standard receiver pwm output?
Re: sbus control of pins
the number of users that have asked this i have noted, and it would be simple to do. i could make it. but someone else i was talking to about it, said that on the x8r rx and maybe yours too, while the sbus was being used you could still use the standard pwm outputs for other things, like the switcher. can you check this ?
Re: sbus control of pins
ok here is a quick mod that enables 3 rx channels (in this case 9, 10 & 11) to be output on pwm outputs camroll, campitch & camtrig.
as such it is incompatible with using SERVO_MIX_TILT, SERVO_TILT or CAMTRIG config.h options (though the output pins could be changed to unused motor outputs if needed)
Firstly add the following code to your Config.h:
Lastly in Output.cpp:
just before:
add:
as such it is incompatible with using SERVO_MIX_TILT, SERVO_TILT or CAMTRIG config.h options (though the output pins could be changed to unused motor outputs if needed)
Firstly add the following code to your Config.h:
Code: Select all
#define RXPASSTHRU //enable/disable channels 9, 10, 11 output on camroll, campitch & camtrig pins
/* The following 3 defines are put here for convenience instead of def.h */
#if defined(RXPASSTHRU)
#define SERVO
#define SEC_SERVO_FROM 1 // use servo from 1 to 3
#define SEC_SERVO_TO 3
#endif
Lastly in Output.cpp:
just before:
Code: Select all
/**************** compensate the Motors values ******************/
#ifdef VOLTAGEDROP_COMPENSATION
add:
Code: Select all
/**************** RX PASS THROUGH ******************/
#if defined(RXPASSTHRU)
servo[0] = rcData[8]; //channel 9
servo[1] = rcData[9]; //channel 10
servo[2] = rcData[10]; //cahnnel 11
#endif
Re: sbus control of pins
Awesome, I'll give that a try as soon as the receiver arrives here.. unfortunately, it's still on the way.
And yes, the standard PWM outputs are supposed to work, but they're on channels 1, 2 and 3 unfortunately, not added to the end.
And yes, the standard PWM outputs are supposed to work, but they're on channels 1, 2 and 3 unfortunately, not added to the end.
Re: sbus control of pins
This doesn't seem to work. I get no compilation errors, but also no function.. even though multiwii wingui displays Aux 5&6 as working and switching properly.
Edit: Works now. #define DISABLE_SERVOS_WHEN_UNARMED had to be commented out. Thanks!
Edit: Works now. #define DISABLE_SERVOS_WHEN_UNARMED had to be commented out. Thanks!
Re: sbus control of pins
yes, this mod will not work with any servo code, stock works for me
Re: sbus control of pins
Could you also please post the code to use unused motor output pins? Thank you.
Re: sbus control of pins
Arakon wrote:Could you also please post the code to use unused motor output pins? Thank you.
would be a little bit trickier, but could be done, though i kinda dont have time, why cant you use servo outputs ?
Re: sbus control of pins
Not a problem then, I didn't realize it would be more complicated than just modifying the output pins in the code you posted.
I can use the servo outputs, but someone else with the same issue asked about this on another forum, and they have the servo outputs in use for a gimbal.
I can use the servo outputs, but someone else with the same issue asked about this on another forum, and they have the servo outputs in use for a gimbal.
Re: sbus control of pins
yeah, thats a possibility. but it would be a matter of enabling the extra motor pins with their timers perhaps by the number of motors config variable, but then you need to stop mw manipulating them for stability/trust