Reset when trying to start RTC oscillator

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Reset when trying to start RTC oscillator

864 次查看
abbian
Contributor II

Hi

I'm using a K12 micro and want to use an external crystal on EXTAL32/XTAL32 as the source for the FLL and RTC.  When I try to start the RTC oscillator using the following code I get a reboot at line 3.

1. SIM_SCGC6 = SIM_SCGC6_RTC_MASK;

2. RTC_CR  = RTC_CR_SWR_MASK + RTC_CR_SC4P_MASK + RTC_CR_SC8P_MASK + RTC_CR_CLKO_MASK;

3. RTC_CR  &= ~RTC_CR_SWR_MASK;

4.  RTC_CR |= RTC_CR_OSCE_MASK;

I read on this forum that VBAT left floating can cause this.  This is how my design is implemented.  Could there be another issue causing the reset?  If this is the cause, is there a workaround?

Thanks,

Dan

标签 (2)
标记 (1)
0 项奖励
回复
1 回复

714 次查看
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Dan Rhodes:

The RTC is powered from VBAT pin, which is a different power domain from the MCU VDD power. It is normal that there is a hardfault when accessing the RTC registers if there is no VBAT power. There is no workaround, this is how it is designed.

If you are not interested in the RTC working during power outage, you can simply hang the VBAT pin to VDD.


Regards!,
Jorge Gonzalez

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------