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

TIMER_TASKS_START increases power consumption when TWI is in use from 13uA to 450uA

Hi, i would like to implement a very low power counter and used the template from this post. I've modified the example and used TIMER2 in counter mode triggered by LPCOMP through PPI. This worked fine and results in 13uA for any number of counts. After this i've implemented a TWI sensor and the power consumption increases to 450uA, even when no sensor is connected to the DK.

I'm using a NRF52 DK and the Power Profiler Kit to measure the consumption. It makes no difference if i use TWI0 or TWI1. I've tested also in SPI Master mode on SPI1 without TWI1. It has the same effect. Changing from SPI1 to SPI2 solved the Problem with SPI. Unfortunatly i need to use SPI and TWI.

attached you will find the code for nRF5 SDK 11.0.0. timer_counter_mode_low_power_new.zip

In main() you may either comment out the line NRF_TIMER2->TASKS_START = 1; and keep the line I2CScanDEvices(); or vice versa to have a low consumption.

When you keep both lines active it results in the high consumption. Where does it come from? Do i need to start the timer in counter mode?

Parents
  • Hi,

    This is most likely due to erratum 89:

    ###Symptoms Static current consumption between 400 µA to 450 µA when using TWI in combination with GPIOTE.

    ###Conditions GPIOTE is configured in event mode TWI utilizes EasyDMA ###Consequences Current consumption higher than specified

    What the documentation doesn't mention is that the erratum affects both TWI instances (TWI0 and TWI1) and the SPI instances with shared resources (SPI0 and SPI1). Furthermore it doesn't mention that timers might possibly also cause the anomaly, not just the GPIOTE. The reason the documentation isn't more specific is that we haven't had the time yet to investigate and document which peripherals are affected.

    Unfortunately the workaround has not yet been implemented in the TWI driver or library. Since the library doesn't un-initialize the TWI after each transaction I think it is easiest to abandon the library and use the drivers directly. Then you can implement the workaround in nrf_drv_twi_init() and uninit() and make sure to initialize the TWI when not in use.

    This erratum is also found in the nRF52840 Engineering A, but not in nRF52810.

  • Hi Martin, thanks for the details on erratum 89. I've checked with the driver directly and called nrf_drv_twi_init() before each twi transfer and nrf_drv_twi_uninit() after each transfer. Unfortunatly power consumption stays the same. When i don't start the timer, the power consumption is very low and the counter is also working. Is the TASKS_START only required in Timer mode? Is there any disadvantage in not starting the timer in counter mode.

Reply
  • Hi Martin, thanks for the details on erratum 89. I've checked with the driver directly and called nrf_drv_twi_init() before each twi transfer and nrf_drv_twi_uninit() after each transfer. Unfortunatly power consumption stays the same. When i don't start the timer, the power consumption is very low and the counter is also working. Is the TASKS_START only required in Timer mode? Is there any disadvantage in not starting the timer in counter mode.

Children
No Data
Related