KW40Z_Connectivity_Software_1.0.1 (KSDK_1.3.0) IAR 7.50
Is it possible to use hardware RTC without external crystal oscillator ?
If the chip runs in DCDC bypass mode same question.
Hi Lucian Firan
Yes, you can use LPO, witch is a clock generated by the PMC. This change is made when you call CLOCK_SetBootConfig(&g_defaultClockConfigRun);
defaultClockConfigRun is a structure defined as:
const clock_manager_user_config_t g_defaultClockConfigRun =
{
    .mcgConfig =
    {
        .mcg_mode           = kMcgModeBLPE, // Work in BLPE mode.
        .irclkEnable        = true,  // MCGIRCLK enable.
        .irclkEnableInStop  = false, // MCGIRCLK disable in STOP mode.
        .ircs               = kMcgIrcSlow, // Select IRC32k.
        .fcrdiv             = 0U,    // FCRDIV is 0.
        .frdiv   = 5U,
        .drs     = kMcgDcoRangeSelLow,  // Low frequency range
        .dmx32   = kMcgDmx32Default,    // DCO has a default range of 25%
        .oscsel  = kMcgOscselOsc,       // Select 
    },
    .simConfig =
    {
        .pllFllSel = kClockPllFllSelFll,    // PLLFLLSEL select FLL.
        .er32kSrc  = kClockEr32kSrcOsc0,     // ERCLK32K selection, use OSC0.
        .outdiv1   = 0U,
        .outdiv4   = 1U,
      
    }
};So, you need to change .er32kSrc from kClockEr32kSrcOsc0 to kClockEr32kSrcLpo.
Hope this information helps you
Have a great day,
Jorge Alcala
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------