I see no voltage on the K20 RTC pins XTAL32 & EXTAL32. The BSP does turn on this External Crystal.
Any have any idea why?
I am expecting about 1/2 voltage.
Hi Kalior:
I think first you need to check the register OSC_CR , Bit 7 ERCLKEN , make sure that external reference clock is enabled
Then you can check the MCG control 2 Register, what is the value?
Regards
Daniel
If the System Osc isn't being used, still set the OSC_CR, bit 7? I have tried both ways. Currently, I have it set to zero. MCG_C2 = 0, MCG_C7=0x01. Which should select the XTAL32 & EXTAL32, instead of the XTAL0 & EXTAL0.
Will the RTC work at all, if the VBAT is flowing?
You are right. If the system OSC isn't being used, you do not need to set the OSC_CR , bit 7.
RTC is powered by VBAT.
MCG_C2 = 0 and MCG_C7 =0x01, that is OK
Please also check the RTC Control Register (RTC_CR)
You need to enable OSCE: Oscillator Enable; configure the CLKO, according to your requirement.
SC20, SC4P, SC8P, SC16P, you need to configure them according to the schematic.
Regards
Daniel
I do have RTC_CR, bit OSCE set to a one.
Do you know if the any of the RTC registers will work, if VBAT is flowing?
Yes, if VBAT is flowing, the RTC registers can be accessed. But when the chip main power lost, the core doesn't work and couldn't access the RTC registers.