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

How to measure current on the nRF52840 Preview DK?

I have a PCA10056 Preview DK that I want to measure CPU active current on (amongst other things). The DK version is 0.12.0.

Setup:

  • I have the DMM (Keysight 34465A) connected to P22.
  • SB40 is cut.
  • SW6 is in the "nRF ONLY" position.
  • I cut SB13-15, SB16 and SB20-22 around external flash.
  • SW9 is in the "VDD" position.
  • Power is supplied through the J2 USB connector (the debugging connector).

Code:

NRF_P0->DIRSET = 0xFFFFFFFC;
NRF_P0->OUTCLR = 0xFFFFFFFC;
NRF_P1->DIRSET = 0xFFFFFFFF;
NRF_P1->OUTCLR = 0xFFFFFFFF;

NRF_POWER->DCDCEN = 1;
NRF_POWER->DCDCEN0 = 1;

NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;
NRF_CLOCK->TASKS_HFCLKSTART = 1;
while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0);

while (1)
{

}


According to the product spec, with CPU running, HFXO and DC/DC enabled, I should see ~3.3mA draw. I see 2.0mA. Normally lower current is great, but I think I am doing something wrong. What else do I need to do to get the values in the spec?

Parents Reply Children
  • It turns out I had to add the following code before the HFCLK initialization to get the current draw to match the spec:

    for (uint8_t i = 0; i <= 8; i++)
    {
        uint32_t test = NRF_POWER->RAM[i].POWER;
    }

    I actually started with writing 0xFFFF to the POWER register, but switched to this and it still produced the correct result. It has something to do with the POWER register, because using a different register (I tried the same thing with NRF_P0->IN) didn't work.

    However, I don't know why I had to do this. I tried this on Rev B and C chips with the same result. Any ideas?

Related