Content originally posted in LPCWare by tkggitfk24 on Thu May 12 19:55:38 MST 2016
Hello Everyone,
I'm getting crazy about RTC, if the rtc oscillator is not populated or broken, my whole system will be corrupted. This is not acceptable for us.
and I know write the rtc and Alarm timer registers without the 32 kHz clock can stall the CPU from the LPC4357 User Manual. So the key point is how to check rtc oscillator is running?
The User Manual says that,
Quote:
To confirm that the 32 kHz clock is running, read the Alarm timer counter register (DOWNCOUNTER, see Table 866), which counts down from a preset value using the 1024 Hz signal derived from the 32 kHz oscillator.
I think it is NOT feasibility.The DOWNCOUNTER and PRESET are zero after reset.
The following is what I tested:
1.
void Chip_Clock_RTCEnable(void)
{
LPC43XX_CREG->CREG0 &= ~((1 << 3) | (1 << 2));/* Reset 32Khz oscillator */
LPC43XX_CREG->CREG0 |= (1 << 1) | (1 << 0);/* Enable 32 kHz & 1 kHz on osc32k and release reset */
}
after invoking this function, the system corrupted without RTC oscillator
2. Writing DOWNCOUNTER and PRESET registers of Alarm timer, just one time, the system corrupted
Does anyone have any idea or suggestion? I would really appreciate it.
Thank you!
Leo