-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
WS2812 or WS2811 with timer 2 #591
Comments
the chibios systick uses timer 2 unfortunately. timer 2 and timer 5 are the only 32 bit timers in the stm32f4 fit for chibios. Timers 3 and 4 are supported because they are the 2 timers historically available on extra io pins for most hardwares. Either on the hall sensor port or the servo port. also they support dma which i think is required? I do not believe that timer 5 is being used for anything if one of it's gpio's is accessible. but it needs to be enabled. timer 13 (PA6) or 14 (PA7) may be able to be used as well, though they may not be able to access DMA? which i think is required for ws2812 control. Basically, the hardware timers are tightly integrated with the way vesc works and playing around with them without being careful and understanding the larger system can quickly break things. what reason do you want to use a different timer? |
Appreciate your quick response. Basically I have a hardware design where I am utilizing almost all of the available pins including timer3 and timer4. PB3/ Timer2 is the only remaining pin which I could use for the LEDs as I also noted it has DMA access. If you say that timer5 could potentially be used for ChibiOS control, would it be a matter of simply swapping 2 to 5 in the below to free up timer 2 for the leds?: Thanks again for your help. |
I think that would work. Both timer 2 and 5 are 32 bit so that should be the only change needed. Try it and see if it works. Then getting the led package to work is the other thing. |
Thanks Ill give this a try ! Yeah the other part should not be too difficult. |
I see the latest code supports timer 3 and timer 4 (https://github.com/vedderb/bldc/tree/master/lispBM/c_libs/examples/ws2812/code.c)
Is there any reason it is limited to these 2 timers, is there any reason this cant be extended to support timer 2 for certain hardware needs?
Thanks in advance.
The text was updated successfully, but these errors were encountered: