This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2340R2: Reset vs shutdown current

Part Number: CC2340R2
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Hello,

SDK LPF3 8.10.1.2

According to datasheet, the expected power consumption in shutdown is the same as in reset (165nA).

As a reference, when I hold CC2340 in reset, my board input current is stable (no activity whatsoever) at 125uA.

If I release reset, the CC2340 toggles a pin for a few seconds and then calls Power_Shutdown(0,0), all of this in an infinite loop.  The pin stops toggeling so that means the call to Power_shutdown did not return (which is ok).

The pin toggled  is not connected and left as an output when going to shutdown.  All other pins are left in their default reset state from the start.  I assume they are all inputs and they are all pulled down externally.

However, the input current shows periodic current peaks  with a much higher current floor (don't mind the extra noise):

Peaks period is roughly 17ms.

These periodic peaks are not present while in reset. Moreover, as there is a pullup on the reset line, current draw should actually be higher in reset.

Any clue to what's going on?  

Power_init() is called at beginning of main().  Are there some registers (or library calls) I should configure before calling Power_Shutdown()?

Regards

  • Hi Fred,

    It seems something else is on. Are you doing this on a launchpad or your custom board? Try the ShutdownGPIO example which disables the GPIO so nothing else is drawing current.

    Best regards,

    Bun

  • Hi Bn,

    I have my own custom board.  That's why my baseline is at 125uA in reset.

    I would need to port gpioshutdown project.  Below is my very simple code (nortos), widely inspired from gpioshutdown project. 

    GPIO24 is not connected (a test point).

    All other I/Os are externally driven or pulled down, except for SWDIO and SWDCK which are left not connected (no XDS110 attached).

    Let me know if something is wrong.

    Thank you for your assistance

    int main(void)
    {
      volatile uint32_t i,j;

      Power_init();
      PowerLPF3_selectLFXT();
      PMCTLSetVoltageRegulator(PMCTL_VOLTAGE_REGULATOR_DCDC);
      GPIO_init(); //GPIO21 and GPIO 24 are configured as output low (sysconfig)

      GPIO_setConfig(21,GPIO_CFG_INPUT_INTERNAL); //Had been set to output by GPIO_init (sysconfig). Pin has a pulldown.

      GPIO_setConfig(6,GPIO_CFG_OUTPUT_INTERNAL); //No connect pin, don't leave pin floating

      while(1) {

      //Toggle a pin for roughly 9 sec
      for(j=0;j<20;j++)
      {
        GPIO_write(24, 1);

        for(i=0;i<1000000;i++); // 100k iter -> 22.91ms
        GPIO_write(24, 0);
        for(i=0;i<1000000;i++);
        }

      Power_shutdown(0,0); //Parameters unused for C2340R2

      }

      return 0;
    }

  • Found anything suspicious in my code?

    Thanks

  • Hi Fred,

    Sorry for reply response. I looped our software engineer to help review the code. To narrow down the issue from the hardware, start with pulling up or down all DIOs unneeded to run the code driven or not.

    Best regards,

    Bun

  • You mean, no pin shall be configured as an output before going to shutdown?  

  • Correct. The idea is to isolate the chip's current draw by removing any external peripheral. 

  • Hi !

    The "for(i=0;i<1000000;i++);" instruction might get optimized out by the compiler if the optimization level is high enough. Can you check if running the loop for longer by increasing the limit of 1000000 changes the time where it stalls ?

    Kind regards,
    Lea

  • I can't see how/why the loop would be a concern.

    Compiler optimization is at -g (for debugging) and i is volatile.  The loop should not be optimized much.  As a matter of fact, the oscilloscope and current draw both match the code.  Exact loop time is not an issue.  This is only test code.

    What do you mean by "stall"?  Nothing stalls, except during the shutdown state, if that's what you mean by "stall".  It stays forever in shutdown state since no wakeup event is configured.

    So, behavior appears ok until Power_Shutdown() is called; then the current goes weird (too high and periodic peaks).  Pulling reset low brings the current to almost nothing as it should.  No more periodic peaks.

    Thanks for giving a shot

  • When doing your suggested test, I noticed the consumption changed upon XDS110 removal. 

    Finding the root cause turned out easy from that point: internal pulldown was missing on SWCLK pin (DIO17). 

    It did not come to my mind since leaving the pin unconnected is documented as acceptable (not preferred) practice for this pin (table 6-20).  Actually, I wonder how this could be acceptable at all, unless there would be some permanent internal pulling resistor, which  is obviously not case. 

    Case closed.

    Thanks to everyone.