Reset when trying to start RTC oscillator

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Reset when trying to start RTC oscillator

1,259件の閲覧回数
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 返信

1,109件の閲覧回数
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!
-----------------------------------------------------------------------------------------------------------------------