I've been playing around with some code that puts my hardware into System OFF mode to save power, and then will exit this mode and start up when one of three different GPIO's trigger it.
I then attempt to establish which GPIO has caused the exit from System OFF by reading the value of the LATCH register.
But I've been having heaps of issues with the LATCH register value being reset if I get more than one GPIO trigger signal in < 200msec of a previous one (it could be the same GPIO, or it could be one of the other ones - these are both likely scenarios in my application)
If I monitor the GPIO signal that is designed to trigger exit from System OFF on my scope, and then set and clear another GPIO as the very first thing I do in my code, and monitor that signal on my scope as well, I am seeing anything from 200msec up to nearly 500msec delay. So, there is something going on in the background during the "exit from System OFF" process that is adding this 500msec delay into the process. This means that if I get another GPIO trigger during this process, the value of the LATCH register gets reset, and I can't then determine which GPIO caused the exit.
I recall when I used to code Cypress chips that Cypress stuff a 500msec delay into their compiled code to allow the LFCLK time to settle after a reboot. Potentially it could be something like this? Or, it could be something totally different!
Anyway, what I want to find out is:
1. What's causing this delay
2. Can I shorten it to something < 20msec
3. If not, is there some way I can grab the value of the LATCH register within the first 10-20msec of the GPIO trigger so I can then run the rest of my code successfully?
Cheers,
Mike