Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using a different TIMx and pin resource for LED strip on Naze32 #2512

Closed
mamalala opened this issue Nov 26, 2016 · 1 comment
Closed

Using a different TIMx and pin resource for LED strip on Naze32 #2512

mamalala opened this issue Nov 26, 2016 · 1 comment

Comments

@mamalala
Copy link

Hello,

i'm wondering if someone could give me hand and help me figure out what to change to have the WS2811 LED strip use a different timer and pin on a Naze32 (and maybe others).

The reason is that i have a serial RX (some generic DSMX satellite), but also want to use a GPS on a softserial. Currently, enabling softserial will disable the LED strip. This is no surprise, since they both use the same TIM3 resource.

Since a serial RX is used on UART2, there is no need to have any of the PWM/PPM RX options, which (if i understand the sources correctly) use TIM2. So my thought was to move the LED strip to TIM2 on GPIOA0 (which is otherwise used for the PPM input).

However, so far my attempts to do so have failed. While i have changed TIM3 to TIM2 in the light_ws2811strip_stm32f10x.c file, as well as changed the GPIO_Pin_4 to GPIO_Pin_0 there, and changed the "#define LED_STRIP_TIMER TIM3" in target.h to TIM2, no luck in getting it to work. With those changes, once all the stuff is enabled in the configurator, the board simply freezes after booting up.

I'm pretty sure that i am overlooking/missed something there. But since i'm rather new to the codebase, i have a hard time finding what the issue could be. Is it that TIM2 is used elsewhere, despite PWM/PPM input being disabled?

I'm sure that being able to assign a TIM2 and a different pin for the LED strip would be useful for others as well who are in a similar situation. At least as a compile-time option.

So, if anyone could point me into the right direction that would be greatly appreciated. Once i get that working i could then open a pull request to maybe have that integrated into the mainline.

Thanks,

Chris

@McGiverGim
Copy link
Contributor

I don't know if it can help you:
#2136

@hydra hydra closed this as completed Feb 25, 2017
martinbudden pushed a commit to martinbudden/cleanflight that referenced this issue Feb 28, 2017
martinbudden pushed a commit to martinbudden/cleanflight that referenced this issue Nov 28, 2017
…r_comp_channel

Fix PWM outputs using complementary timer channel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants