K10 RTC Configuration

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

K10 RTC Configuration

664 Views
psjhawer
Contributor II

Hi all,

I'm a newbie to kinetis MCUs and CW too. I'm trying to configure RTC on MK10DX64VLH5 which will display the time on LCD and print the date and time at some pre-defined intervals on an APS thermal printer. I have 2 crystals of 32.768Mhz each for SOSCI SOSCO - Connected to PTA18 and PTA19 respectively and OSCI, OSCO - Connected to XTAL32, EXTAL32. VBAT is also charged up to 3 Volts

For this i've been trying to configure RTC but every time I debug the debug gets halted in:

{

  /* This code can be changed using the CPU component property "Build Options / Unhandled int code" */

  PE_DEBUGHALT();

}

and if I try to step over it goes and gets stuck in:

SIM_SCGC6 |= SIM_SCGC6_RTC_MASK;

-->  if ((RTC_CR & RTC_CR_OSCE_MASK) == 0u) { /* Only if the OSCILLATOR is not already enabled */

I found a similar discussion https://community.nxp.com/thread/302968?q=k10%20rtc   and tried to resolve as suggested there but failed. I'm sure im missing some smal details in the clock configuration.

PFB my MCu's clock configurations and suggest me what to do and how to go about this particular issue.

Clock Configuration1.jpgClock Configuration2.jpgClock Configuration3.jpg

PFB The RTC component configuration too...

RTC Configuration.jpg

Feel Free to ask any further questions.

Thanks in advance.

Regards,

Prafful Sagar:smileyhappy:

Labels (1)
0 Kudos
Reply
1 Reply

518 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Prafful,

    You said:"I have 2 crystals of 32.768Mhz"

    Did you add 32.768Mhz? not 32.768Khz in your external circuit?  You need to use 32.768Khz crystal and connect it in the EXTAL32 and XTAL32 pin.

  For the codewarrior RTC PE code, please refer to this TWR-K21D50M and configure your code again.

  I already attached it, please refer to it at first.

  If you still have question, please let me know!


Have a great day,
Jingjing

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

0 Kudos
Reply