Part Number: CC2652P7
Other Parts Discussed in Thread: SYSCONFIG
I'm observing some time drift (3 seconds per day in one case) in modules that spend a lot of time in low-power mode. I only have the 48MHz crystal mounted, so I assume this is from reliance on the RCOSC. I have a GPIO that is pulled to ground when the module is on a "base station" where power is abundant, therefore, I would like it to startup and rely on the 48MHz crystal for all timekeeping. I originally thought that I could Sysconfig the LF Clock to derive from HF, the at init do:
if (GPIO_read(BASE_GPIO) != 0)
{
OSCClockSourceSet(OSC_SRC_CLK_LF, OSC_RCOSC_LF);
while (OSCClockSourceGet(OSC_SRC_CLK_LF) != OSC_RCOSC_LF)
;
}
However, this doesn't achieve low-power. It idles around 1mA, whereas if Sysconfig LF is RCOSC, it is down ~90uA. Maybe there is another route to go. The alternative is to init with RSOSC, then change to sourcing the XOSC_HF (it appears this is what happens when you select "Derived from HF XOSC in Sysconfig), but when I try to connect over BLE it times out:
if (GPIO_read(BASE_GPIO) == 0)
{
OSCClockSourceSet(OSC_SRC_CLK_LF, OSC_XOSC_HF);
while (OSCClockSourceGet(OSC_SRC_CLK_LF) != OSC_XOSC_HF)
;
}
I see that the Sysconfig output is only used in building the .ccfg and loaded at boot, so I'm not sure this is the correct route.