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

High current problem for app_pwm SDK13.0

Hi,

I am working on nRF52832 with SDK13.0 + GCC Eclipse.

I have used 2 app_pwm instances for driving a 3 color led. Once I init the pwm and set the duty cycle, the current increase from 3uA (sleep state) to 6.5mA. This 6.5mA current is just for the MCU as I have a separate power supply for the LED, the MCU is sinking current from the LED. When I call app_pwm_disable and app_pwm_uninit, the current still keep at 6.5mA.

Further more, if I just init the pwm but not set the duty cycle, it would be just 1mA and able to go back to 3uA sleep when I disable the pwm.

I have searched for some post about the pwm which mention about the pan73_workaround fix but I already found that in app_pwm_disable.

I have 2 questions: Is 6.5mA normal for using app_pwm? How to remove that 6.5mA when I disable the pwm?

Regards, George

Parents
  • If you are using the FPU, you will need to use the workaround shown in the link I posted.

    If you are using the SoftDevice, you should use sd_app_evt_wait(); to enter sleep after you apply the workaround:

    static void power_manage(void)
    {
        #if (__FPU_USED == 1)
         _set_FPSCR(_get_FPSCR() & ~(0x0000009F)); 
         (void) __get_FPSCR();
         NVIC_ClearPendingIRQ(FPU_IRQn);
        #endif
        uint32_t err_code = sd_app_evt_wait();
        APP_ERROR_CHECK(err_code);
    }
    

    If you are not using the SoftDevice, you use the __WFE(); / __SEV; instead of sd_app_evt_wait();

Reply
  • If you are using the FPU, you will need to use the workaround shown in the link I posted.

    If you are using the SoftDevice, you should use sd_app_evt_wait(); to enter sleep after you apply the workaround:

    static void power_manage(void)
    {
        #if (__FPU_USED == 1)
         _set_FPSCR(_get_FPSCR() & ~(0x0000009F)); 
         (void) __get_FPSCR();
         NVIC_ClearPendingIRQ(FPU_IRQn);
        #endif
        uint32_t err_code = sd_app_evt_wait();
        APP_ERROR_CHECK(err_code);
    }
    

    If you are not using the SoftDevice, you use the __WFE(); / __SEV; instead of sd_app_evt_wait();

Children
No Data
Related