This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

PWM consumed power

I am now based on nrf52832 SDK14.2 development, I tried to use the PWM driver and timer to drive the corresponding two IO port an irregular waveform, I originally thought that the PWM mode will be more power, but the test found the opposite Is this normal? (both PWM and timer use NRF_PWM_CLK_250kHz clock)? What caused it? Is it related with PWM using easyDMA, if yes, can you disable easyDMA function when using PWM?

  • Hi,

    Generally, the PWM driver will draw some more current due to the EasyDMA logic, but the PWM driver is very flexible, and the built-in decoder and EasyDMA capabilities make it possible to manipulate the PWM duty cycles without CPU intervention.

    What examples in the SDK did you test? pwm_driver and pwm_library?

    What results did you get?

    Note that the PWM library example in the SDK is not power optimized(uses nrf_delay_ms() that will keep the CPU active)

  • Thanks for your instant reply!

    I tested the pwm_driver example. Method 1 drives the GPIO to generate irregular waveforms by using the PWM_driver method. The second method is to timer (NRF_DRV_TIMER_INSTANCE, constantly adjusting the length of the timer) to interrupt the flip GPIO port. The waveforms output by Method 1 and Method 2 are very Accurate, but the current of method 1 is large, is this normal?
    If I need to output a 6-cycle pulse with a fixed duty cycle on an IO port, do I not need to use easyDMA and the current will be smaller?

  • Hi,

    Jim said:
    but the current of method 1 is large, is this normal?

    What did you measure? Updates of duty cycle values will require the EasyDMA to be active, adding about 1.2 mA to the current consumption, but the updates can be done without CPU intervention.

    Jim said:
    If I need to output a 6-cycle pulse with a fixed duty cycle on an IO port, do I not need to use easyDMA and the current will be smaller?

    I believe that is correct, with a fixed constant duty cycle value, the PWM peripheral will draw less current. I did a quick test here, and measured around 400µA for that scenario.

Related