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

nRF52840 LPCOMP abnormal power consumption?

Calling of nrf_drv_lpcomp_enable() increases custom device's power consumption from less than 50 uA to 600 uA.

  • The typical run current for the low power comparator is roughly 0.5 uA, so it seems this is a lot higher than typical (see link). How are you measuring the current? Are you using an SDK example or your own custom code? I will check on my nrf52840 to see if this is the same for me. Might be that the high frequency clock is turning on, but I will have to test a bit to check.

  • It seems to be the same issue as in Errata 3.12 [89] "TWI: Static 400 μA current while using GPIOTE" and with the same workaround... But I don't use GPIOTE itself. In the part of code with this issue there is:

    a number of GPIO pins init,
    TWI init, exchange with external IC to set it to PD, TWI uninit.
    SPI init, exchange with another external IC to set it to PD, SPI uninit.
    then lpcomp init as in lpcomp example.
    

    I tried to tie different analog inputs to lpcomp and commented a handler for doing nothing, but only the function nrf_drv_lpcomp_enable() have an influence to power consumption. When nrf_drv_lpcomp_enable() is commented, there's no abnormal consumption. I can't exactly test it without twi and spi usage because a power consumption of external ICs is higher when not in PD mode. Applying workaround as in Errata 3.12 [89] has solved this question.

  • After discovering this issue - no, because this code is for sleep mode. I exclude all other parts of code by placing if(1) instead of function that checks if sleep mode needs, so, the code for nrf_drv_gpiote_init() doesn't exist completely (watched it in the debugger). But I don't know if GPIOTE is used by SPI or other nrf driver funcs. CS pin for SPI set and cleared manually in my code without GPIOTE.

    ps. this was an answer on using GPIOTE then (that was in up comment before)

Related