1 Reply Latest reply on May 12, 2016 4:15 AM by userc_38441

    Stop Mode PSoC 4 Saving GPIO states



      I am using a PSoC 4 (CY8C4245PCI-482) and plan on putting the device into STOP mode to conserve power.  I am freezing the IO, but I also want to retain the states of the output.  Is there any flash that I can store the states of the GPIO in?  It appears that the following works when I go into hibernate mode:  uint16 CY_NOINIT switchState,but I am also looking for an alternative that will also work in STOP mode.





        • 1. Re: Stop Mode PSoC 4 Saving GPIO states

          You need to do a freeze and unfreeze IO to retain the state of the pin after stop mode. Attaching the text from the GPIO appnote,




          "In the case of Hibernate and Stop mode, wake up happens with a device reset. This clears the GPIO configuration and the state. To retain the pin state, use the CySysPmFreezeIo() and CySysPmUnfreezeIo() APIs. Note that you do not need to call the CySysPmFreezeIo()function for Stop mode since it is automatically called when the user invokes Stop mode using the API CySysPmStop(). However, you should call the CySysPmFreezeIo() API just before the function call to enter the Hibernate mode. The GPIOs are unlocked with the call to API CySysPmUnfreezeIo(). Call to this API is also required when the exit is made from the Stop mode. Note that the Frozen pin states and configurations are not maintained on an external reset (XRES) event.  "