Using STM32F103C8T6 PWM pin to drive ws2812b Neopixel Ring in arduino IDE
Posted: Wed Jun 10, 2020 4:36 pm
So, I've been trying to use pwm pin of STM32F103C8T6 board (bluepill) to drive WS2812b RGB ring, but i'm not such a pro to achive that. Firstly I tried to use this: https://github.com/adafruit/Adafruit_NeoPixel library, but it seems to work only on arduino board. Then I tried this: https://github.com/rogerclarkmelbourne/ ... 2_Libmaple , but it uses SPI1 port, which i'm using to drive NRF24L01 module, and i think that it's impossible to drive them both like I2C bus devices. I though about using second SPI line which STM32F103C8T6 provides, like in this post: https://github.com/rogerclarkmelbourne/ ... 2/pull/536 , but again this doesn't seem to be possible to change default SPI1 line in https://github.com/rogerclarkmelbourne/ ... 2_Libmaple library. I also tried to set PWM line to 800kHz like :
HardwareTimer timer(1);
void setup() {
pinMode(PA10, PWM);
timer.setPrescaleFactor(1);
timer.setOverflow(90);
}
void loop() {
pwmWrite(PA10, 90);
}, which also didn't work.
So what would be really helpful is: help me to drive it somehow with PWM signal, use second SPI line to drive WS2812b Neopixels, use one SPI line to drive NRF24L01 and WS2812b Neopixels. I hope for your help
HardwareTimer timer(1);
void setup() {
pinMode(PA10, PWM);
timer.setPrescaleFactor(1);
timer.setOverflow(90);
}
void loop() {
pwmWrite(PA10, 90);
}, which also didn't work.
So what would be really helpful is: help me to drive it somehow with PWM signal, use second SPI line to drive WS2812b Neopixels, use one SPI line to drive NRF24L01 and WS2812b Neopixels. I hope for your help
