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

51802 debug mode consuming less power?

Hi community, I'm running a 51802 on my custom board with no other parts on it, except for some buttons and leds directly connected to GPIO, and a DC/DC converter which feed the 51802 with 1.8V power directly. I'm running a custom 2.4G protocol with neither softdevices, nor Gazell lib, which keep 16M clock always running.

Now when I try to optimize power, I've found some interesting thing that I can't find an explanation. I measure current before the DC/DC, so the absolute current read is not so relevant. The cpu is running the main loop steadily merely check for GPIO buttons, not much radio activities except sending a heartbeat packet every second,

the current read 2.21mA.

But if I reset the board to debug mode(with jlink plugged),

the current read 0.96mA.

I've checked this many times to make sure, as long as power is on, the consumption keeps the low state, and there seems no difference of the functionality of the 51802.

So my question is: why in debug mode, the power consumption reduced to about 44% of the normal state? what's changed inside the chip?

  • I've already had a pull down resistor on SWDCLK pin. It's unlikely that my board entered debug mode at the first place. As you can see, after I triggered my board into debug mode using jlink, I long pushed a button on the back of the board to turn it off, then we read a 2.32mA in system off mode, that can prove the board is in debug mode. Then I pushed the button again to turn the board on, it's still 0.88mA, I believe that's the power consumption of the debug mode.

  • I've uploaded a better video to make things more clear:video 2

    In this one I turned on an LED to indicate syetem is on or off. now we can see:

    1. In the first stage, when I powered it on, it's 3.86mA. then I turned it into system off mode, we read 0.02mA, so clearly the chip is in the normal mode.
    2. then I triggered it into debug mode, we got about 2.80mA, after I turned it off, it read 2.32mA, that showed the chip is in debug mode.

    I think this clip can make things obvious, that when my board is in debug mode, the power consumption is less than normal mode, over 1 mA, I can't understand that, I hope I can get some help here, 1mA lower power is a big temptation for me which I don't want to miss.

  • I have not seen this issue before. The results you are seeing could indicate that debug-mode is making something stop in your code, or change the way your code run in some way. Debug-mode itself will not use less power, but could trigger something else in your code to use less power. (e.g. debugmode makes you miss a interrupt that should have started something in your code, etc). If you could provide the .hex file, I can test it here.

  • Yes I've been guessing the same thing, that's why I asked this question at the first place, to check if there's any peripheral should have been stopped but I didn't. But today I've found some more interesting things, I tested my board in BLE mode, the same result. When steadily connected:

    • debug mode on: 3.11mA;
    • debug mode off: 2.33mA;
    • normal mode on: 4.16mA;
    • normal mode off: 0.02mA.

    These two radio mode share the same key scan code, but currently there's nothing I found suspicious. my 2.4G code is very simple, only two int handler, Timer0 and Radio, nothing else, and the main loop look like this:

    	// Enter main loop.
    for (;;)
    {
    	__WFE();
    }
    

    If any int handler miss, the connection can't be held steady. When in debug mode, the board function normally, and the 16M clock is no change, I've checked this with oscilloscope. Anyway, without my usb dongle, you can't test it in 2.4G mode, but you can test in BLE mode, so how should I send the hex file?

  • You can upload the hex in the answer(or google drive, dropbox,etc ). You can also try to use

    __WFE();
    __SEV();
    __WFE();
    

    instead of the single __WFE();, and see if that makes any difference. Aslo, have you had your board-design in for layout review?

Related