- SDK: 15.2
- SoftDevice: s140_nrf52_6.1.0
- FreeRTOS
- Hardware:
- nRF52840 (Custom board running on a 240 mAh battery)
- RGB LED (ARGB1313HS)
Hello,
I am implementing PWM for a single RGB LED. I see that there are a large number of different PWM implementation examples in the SDK. Those being:
- nRF5_SDK_15.2.0_9412b96\examples\peripheral\pwm_driver
- nRF5_SDK_15.2.0_9412b96\examples\peripheral\pwm_library
- nRF5_SDK_15.2.0_9412b96\examples\peripheral\low_power_pwm
- nRF5_SDK_15.2.0_9412b96\examples\peripheral\led_softblink (It seems this is based on 'low_power_pwm' example above)
I have spent quite a bit of time testing the 'pwm_driver' example which uses the PWM hardware peripheral, but I have read on the DevZone that using this consumes a quite a bit of power since it requires the HFCLK to generate the PWM signals. Ideally, it would be nice to use the PWM peripheral since it essentially does what I need it to do.
Question 1: Is the PWM peripheral (pwm_driver example) really that power hungry? If the PWM peripheral is running using DMA while the CPU is sleeping, only the HFCLK and PWM will be consuming power. So, what is the power consumption of A: The HFCLK, and B: The PWM hardware peripheral? I couldn't find these in the nRF52840 product spec v1.7 PDF.
Question 2: The 'pwm_library' uses a hardware timer for the nRF52 which also requires the HFCLK, so is it any more power efficient than using the PWM peripheral (pwm_driver)?
Question 3: 'led_softblink' (also 'low_power_pwm') uses an RTC and application timers to wake the CPU. How does the power consumption of this compare to 'pwm_driver' and 'pwm_library'?
Question 4: For a battery operated device, which PWM implementation (SDK example) above would you recommend for an RGB led that requires blinking, on/off, and fade in/out (aka "Breathing") functionalities?
Thanks,
Derek