Closed gaucho1978 closed 6 months ago
Sure you can. You will need to select another timer and adjust DMA for another timer (different channel) but concept will of course work.
Sure you can. You will need to select another timer and adjust DMA for another timer (different channel) but concept will of course work.
Thank you for reply. I don’t understand: this library uses timer to generate pwm. But timer can be used only with specific gpio. No one of the alternate functions of my gpio are related to timer output, then I suppose I can not use this approach. Where am I wrong?
But you can always change the timer, which is available in your GPIO. Sadly, if there is no timer alternate function on your pin, then you cannot use this pin for signal generation.
Yes, my pin doesn’t have timer as alternate function.
Is it possible to generate custom interrupts at fixed periods and toggle gpio inside that interrupts? Sorry for newbie question.
will it result in a too slow update rate for a 2 meters led strip?
Alternatively you may use SPI if you have MOSI on your pin? Otherwise you will need bitbanging, that will slow your CPU :)
Alternatively you may use SPI if you have MOSI on your pin? Otherwise you will need bitbanging, that will slow your CPU :)
Thank you. Meanwhile I found the way to use another pin with AF timer. Now I’m reading your code to find the way to integrate it in to my code.
unfortunately this library is using LL driver and not HAL. I find too difficult to convert it to STM32F0xx uP, since some functions are using different number of parameters, and I obtain a lot of errors. Can I use some other github repo as starting point?
Driving LEDs with SPI or timer is very advanced topic and not a typical application use case with these IPs. For this reason, HAL drivers don't necessary support all the features in the every neat way. This is then when LL drivers come to play.
I do not have any other repo.
Maybe this can help you if you have access to SPI on your led pin: https://www.newinnovations.nl/post/controlling-ws2812-and-ws2812b-using-only-stm32-spi/
I have no SPI in my free pins. Meanwhile i compiled with success this: https://github.com/Cpt-Quantum/STM32F0-Timer-WS2812 I made some adjustments and I need to double check everything before to try it. I hope I can do it today.
Anyway this repo was really useful to understand the best approach to use, the protocol, and to get support on my problem. At the end I implemented with success the same approach on stm32cube ide. Thank you very much.
I’m on St32f072c8t. I can use only one of these 2 pin to control a ws2812 led strip: PA14 (Alternate functions Usart2_tx and swclk) or PA12 (Alternate functions can_tx, usart_rts, tim1_etr, comp2_out, tsc_g4_io4, eventout, usb_dp) Can I use this library? I suppose no, but I’m a newbie 😁 Any hint for a beginner?