You are here

Stop Mode PSoC 4 Saving GPIO states | Cypress Semiconductor

Stop Mode PSoC 4 Saving GPIO states

Summary: 1 Reply, Latest post by KeerthiRocks on 12 May 2016 04:15 AM PDT
Verified Answers: 1
Last post
Log in to post new comments.
marshg1's picture
6 posts


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.



KeerthiRocks's picture
Cypress Employee
77 posts

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.  "

Log in to post new comments.