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

PWM driver with lower current consumption

Hi, I'm developing on nRf52811 and I want to get PWM working to set my led when I put a pin to high.

I just saw other tickets where using PWM library is not effective (and I tried but yes, not working) so I implemented PWM driver, demo1, to do something aprox to what I want to.
Works well but when I go to check current it goes up from 7,8uA to 280uA.
I think I do something wrong, and maybe there are some tips to follow to reduce that current. I mean maybe some enables on sdk_config put PWM on Low power or something else.
The goal is, when Im charging the device, reduce current of LED to get charged in less time, and when is not charging dont get that current.

Maybe I can use PWM library because I dont use any sequence, just want to put on LED with a duty cycle.

Thank you in advance.

  • I just found and tried low_power_pwm and not works at current I want.

  • Hello,

    If you want a simple PWM, I suggest that you stick to the pwm_library example implementation.

    The reason this is not very power efficient is that the main() loop doesn't have a proper sleep cycle, like most of the BLE examples have. Look at the BLE examples, and see if you can implement this. You need to change the nrf_delay_ms() function with a proper delay function. nrf_delay_ms() will keep the CPU awake, which you don't want to do. Look at e.g. the ble_app_uart example how to implement a proper sleep routine in your main loop.

    If you still think the current consumption is too high after implementing a sleep routine, it is probably because you need to have a timer running in order to use the pwm. I don't know what accuracy you need for your pwm signal, but you may look into changing out the timer peripheral with the RTC if you want to lower it further.

    BR,

    Edvin

Related