nRF52832 PWM0 EasyDMA to stream to WS2812 string

I'm trying to setup an nRF52832 to drive 127 ws2812 by using PWM. It seems the bit-by-bit method is too slow for the 1.25uS period. pwm_set() is using somehow ~5ms, so that is not an option.

I would like to use EasyDMA to drive the PWM peripheral one stream of data that represents all '1's and '0's for all LEDs.

Is this possible in Zephyr, with nrf connect sdk 2.7.0? If so, is there a proper example for this?

The reason I want to use the PWM peripheral is because all other peripherals that could maybe do this (I2S, SPI) are already occupied.

Parents
  • Hi,

    We do not have any samples or recomendations for usig the PWM like this. I2S is typically what is used. It may be possible to use the PWM and play out a sequence from DMA, and we have generic samples for that. To get full control you can use the nrfx low-level driver directly, as demonstrated by the samples under zephyr/modules/hal/nordic/nrfx/samples/src/nrfx_pwm/

  • Hi Einar,
    Thank you, I was questioning the nrfx solution AI suggested yesterday, glad to hear you also recommend that in this case. The device we developed has many functions, including I2S for sound, 2 SPI (one spi for Flash for sound wave and one spi for a  peripheral), I2C for other LED drivers.
    Now I list this, I'm thinking I could try to disengage the I2C for other LED driver (will become unnecessary when the WS2812 work) and setup a 3rd SPI, but first I will try this and let you know if it was successful. 

Reply
  • Hi Einar,
    Thank you, I was questioning the nrfx solution AI suggested yesterday, glad to hear you also recommend that in this case. The device we developed has many functions, including I2S for sound, 2 SPI (one spi for Flash for sound wave and one spi for a  peripheral), I2C for other LED drivers.
    Now I list this, I'm thinking I could try to disengage the I2C for other LED driver (will become unnecessary when the WS2812 work) and setup a 3rd SPI, but first I will try this and let you know if it was successful. 

Children
No Data
Related