Stop Mode

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
AnWa_1259496
Level 4
Level 4
Welcome! 50 replies posted 25 replies posted

Has anyone got the Stop Mode to work?

   

I am not having any problem with CySysPmHibernate();, but CySysPmStop() seems problematic. The first problem is lack of documentation. There is sparse info in the datasheet and nothing in the register manual, plus non chip-specific info in the TRM.

   

As far as I can make out, P2-2 is the pin which wakes from stop mode. But this does not respond if left as GPIO with interrupts enabled. I tried enabling "Chip specific DeepSleep source 0 connection" in HSIOM_PORT_SEL2 and this seems to do something.

   

I dont know if this is active low or high or what, but happens is when this is pulled low the code seems to go haywire. It does not do a complete reset (Hibernate does) but acts as if the clocks have been messed up, just doing random stuff. 

   

Is there any better information on this mode anywhere? What has to be done prior to entering with CySysPmStop();

0 Likes
1 Solution
AnWa_1259496
Level 4
Level 4
Welcome! 50 replies posted 25 replies posted

Managed to unravel this in the end. It seems that the port 2.2 can be left as a GPIO pin when used as a wake from stop. The reason for everything going haywire after waking was the CySysPmStop() call contains a locking of the GPIOs. So the system resets and fires up and cant initialize any of the ports as they are locked, so they are as I left them before Stop, which is Hi-Z.

   

So a CySysPmUnfreezeIo() needs be present in MAIN at the start of code.

View solution in original post

0 Likes
1 Reply
AnWa_1259496
Level 4
Level 4
Welcome! 50 replies posted 25 replies posted

Managed to unravel this in the end. It seems that the port 2.2 can be left as a GPIO pin when used as a wake from stop. The reason for everything going haywire after waking was the CySysPmStop() call contains a locking of the GPIOs. So the system resets and fires up and cant initialize any of the ports as they are locked, so they are as I left them before Stop, which is Hi-Z.

   

So a CySysPmUnfreezeIo() needs be present in MAIN at the start of code.

0 Likes