-
Notifications
You must be signed in to change notification settings - Fork 33
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
STM32F401 - Can only get a solid white light #12
Comments
Hi, Is the systick and the HAL_GetTick working correctly? does the code gets inside this if block? If the IRQs are triggered and its generating correct waveform with white color, then the core code works fine and it seems like the issue is really in assingning the data to the buffer. So you have to set some data to
to set RED (or maybe blue color,since WS2812 has BGR if I' not mistaken) |
Also check that your level shifter works correctly. I always used proper push-pull driver, not sure how fast that 10k pull-up resistor is. Check that with analog oscilloscope. It might be fine but I would check that. |
Just had the same issue and thought I'd quickly post the solution for anyone from the future: How to fix this if you want to change the active pins:
This is a valid configuration:
This is not:
Another thing while I'm at it: |
Hey! I like your approach of using DMA and a timer to generate the signal.
However, I cannot achieve the rainbow or Christmas animation with my current setup.
I left your DMA channel/stream configuration as it is since I do not need TIM1 or this DMA configuration elsewhere.
My setup contains 12 chained
WS2812-2020
LEDs. The PCB on which they are mounted to has a 5v and a 3v3 supply.The LEDs are driven by 5v and that data signal has a level shifter to connect to the 3v3 GPIO pin of the STM32F4.
DATA_IN
is directly connected toPB1
of the STM32.The only modifications I have done to your code so far are those here 👇
My problem is that those LEDs are only lighting up in bright white.
No animation no nothing.
(every button has a pair of two leds. But all 12 LEDs are chained. There is only one Data-In for the entire module)
When I set breakpoints into the
DMA_TransferCompleteHandler()
orDMA_TransferHalfHandler()
I can confirm that those are being called.Also the two
visHandle()
andvisInit()
methods are called properly.Having the white lights turned on means that the communication works.
If there was an issue with the GPIO pin, DMA or Timers I would see nothing.. right?
Thanks for your help!
The text was updated successfully, but these errors were encountered: