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.

Does Power_shutdown() latch GPIO input state?

Other Parts Discussed in Thread: CC2650

Hello,

I understand that when Power_shutdown() is called, it latches the output states of the GPIOs (easy to demonstrate with LEDs staying lit after the call).   But does it also latch the input state for GPIOs configured as inputs at the time Power_shutdown() is called?

If so, can those input states be recovered at the next wake-up from Shutdown, before re-initialization with PIN_init?  That’s exactly what we need here to shutdown to 150nA and avoid having to retain just a few bits in RAM at 1uA in Standby.  An ~order of magnitude power savings.

Looking at an earlier posting, we’re hopeful!
e2e.ti.com/.../420920

In reply to Abhijeet Kanade:
“Shutdown mode only latches IO to their current state and has no retention. When booting up again it is like from a pin reset / power-on except for that a latch bit is set and the reset source register is different. The latch is unfrozen again when re-initialization the IO's with PIN_init in main.”

Thanks,
Brian

  • Is there any way to read the latched GPIO inputs from the previous Power_shutdown?

    I tried the code below, but it does not work... doing the GPIO read before the PIN_init appears to fail.   Is there a register with the latched input values we can read before calling PIN_init which will reset the latch bit?  (as described above?)

    Thanks!

    --------------

    Void main()
    {
      
      int previous_key_left = 1;
      int previous_key_right = 1;
      
      if( SysCtrlResetSourceGet() == RSTSRC_WAKEUP_FROM_SHUTDOWN ) {
      
        //get previously latched input states, before PIN INIT
       previous_key_left = GPIOPinRead(1<<Board_KEY_LEFT);
       previous_key_right = GPIOPinRead(1<<Board_KEY_RIGHT);
        
        PIN_init(BoardGpioInitTable2);
        
        GPIOPinWrite((1<<IOID_15),0);   //green
        GPIOPinWrite((1<<IOID_10),0);   //red
        
        if (!previous_key_left) {
            GPIOPinWrite((1<<IOID_15),1);   //green
        }
        
        if (!previous_key_right) {
            GPIOPinWrite((1<<IOID_10),1);   //red    
        }
        while(1);
      }

  • Hi Brian,

    The input state of a pin at the time shutdown is entered is not latched. The pin will retain its input configuration, and if set of for pin interrupt it can be used to wake up the system.

    Cheers,
    Fredrik
  • Thanks for the response Fredrik!

    Ok, if the input state is not retained, how can we acquire the previous GPIO output state at reset from Shutdown?

    The thinking being that we could just take the input values and write them to outputs while the processor is Active, then go into Shutdown. Then recover those values at reset from Power_shutdown().

    Would that work? Note… we found this in the User Guide.

    Thanks!
    Brian


    AON IOC State Latching When Powering Off the MCU Domain
    The I/O configurations and states can be retained when the MCU and/or AUX domain is powered off. Before powering down the MCU domain, the pin configuration and output values from MCU peripherals mapped to pins (DIOs) through the MCU IOC must be latched in AON IOC. This is done by disabling the transparent mode in the AON_IOC:IOLATCH register. Before enabling the transparent mode after MCU is powered up again, the MCU IOC configuration must be reconfigured to the state it was in before power down.
    If the sensor controller application is using I/Os and simultaneously power cycling the AUX power domain, the I/O signals must be latched (static configuration). There are latches in AON that latch the signals coming from AUX to the GPIO pins. The AUX_WUC:AUXIOLATCH register controls this latch. The reset state of this register is that the latches are closed (in other words, not transparent). Before any IOs can be used, this latch must be opened by writing 0x1 to the AUX_WUC:AUXIOLATCH register. The latches must be closed again before powering off the AUX domain. There are more constraints and reliability issues to consider before powering off a domain; for more details refer to (Refer to Section 17.5, Power Management).