Looking for a little bit of clarification for the P2 with device OS 5.8.0 - Sleep modes (Hibernate, ULP, STOP) documentation says that wake on Time (RTC) or GPIO (WKP only for Hibernation) is supported for all sleep modes for Gen 4. I have been looking at using a WDT IC (AB1805) to provide both hardware watchdog, RTC and Timer. If using the AB1805 timer/alarm to generate an interrupt when sleeping rather than rely on the P2 RTC which isn't that accurate then the P2 is best woken on which pin - I assume WKP/D10 (because that supports all sleep modes). Or would it be better to use IRQ2 from the AB1805 and another GPIO pin on the P2?
On the RTL872x the only pin that can wake up from hibernate mode is WKP. It can also be used to wake up in other modes, so that's the pin you should use.
Note that you need an external hardware pull-up resistor on WKP because the RTL872x does not support software pull in hibernate mode on WKP and the AB1805 FOUT pin is open-drain.
WKP it shall be then.
From your understanding of the AB1805 - a alarm, timer or countdown can product an interrupt on another pin than FOUT, I was assessing the additional value of using another pin. Any views?
Another question about the AB1805 library. Would it be feasible to store the reset reason as OUT_OF_MEMORY and determine this as the wake reason in setup()?
An out of memory reason reason can't be put in the AB1805 library because there aren't bits available for user use in the hardware reset reason register.
The System.reset()
call takes an optional parameter, however. If you put a value here, the reset reason will be available on reset using resetReasonData. You could define your own constant to mean out of memory handler reset.
if (System.resetReason() == RESET_REASON_USER) {
uint32_t data = System.resetReasonData();
What I was trying to get at with the AB1805 library is whether the RAM could be used to store a reason OR one of the other status register values could be used to mean the same as RESET_REASON_USER.
Wanted to close with solution - AB1805 RAM which is battery backed used to store a reset/restart reason before going to sleep if Hibernate (followed by restart) or reset (memory issue etc.). RAM data restored on restart - works nicely. Another reason to have a AB1805.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.