Clock Monitoring unit in MPC5746C

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

Clock Monitoring unit in MPC5746C

Jump to solution
1,851 Views
AshokSubramani
Contributor III
I want to measure a FIRC & SIRC clock monitoring during runtime, if i use while(CMU.CSR.B.SFM == 1U){} my execution has to wait for sometime, to avoid that i am using a logic to come out of the loop if measurement not completed within the time period . so what is the expected time to complete the SIRC and FIRC measurement  by considering ageing factor and lifespan of MCU. Herewith I have added my logic which runs every 10ms. 
 
 
uint8 Clock_Monitor_Runtime(void)
{
    static ClockMonitorState state = FIRC_MONITOR_INIT; /* State variable for both monitors */
    static uint32 elapsed_time = 0U;                   /* Time tracker for timeout */
    static uint32 MeasDur = 0U;                        /* Measurement duration */
    static uint8 result = CLK_IN_RANGE;                              /* Default result to indicate progress */

 

    switch (state)
    {
        case FIRC_MONITOR_INIT:
            MeasDur = 0x8FFFU; /* Set FIRC measurement duration */
            CMU.CSR.B.CKSEL1 = 0x00U; /* Select FIRC clock or CLKMT0_RMN */
            CMU.MDR.B.MD = MeasDur; /* Set measurement duration */
            CMU.CSR.B.SFM = 0x01U; /* Start FIRC measurement */
            elapsed_time = 0U; /* Reset elapsed time */
            state = FIRC_MONITOR_WAIT;
            break;

 

        case FIRC_MONITOR_WAIT:
            if (CMU.CSR.B.SFM == 0U)
            {
                /* FIRC measurement completed */
                FIRC_MeaFreq = CMU.FDR.B.FD;
                Firc_MonitoredClk = ((float32)FXOC_CLK / (float32)FIRC_MeaFreq) * (float32)MeasDur;

 

                if ((Firc_MonitoredClk >= (float32)Min_FIRC_Freq) &&
                    (Firc_MonitoredClk <= (float32)Max_FIRC_Freq))
                {
                    result = CLK_IN_RANGE; /* FIRC clock is within range */
                    state = SIRC_MONITOR_INIT; /* Move to SIRC monitoring */
                }
                else
                {
                    result = CLK_OUT_RANGE; /* FIRC clock is out of range */
                    state = FIRC_MONITOR_INIT; /* Move to FIRC monitoring again */
                }

 

               
            }
            else
          {
             /* Increment elapsed time (10 ms per call)  */
              elapsed_time += 10U;
                if (elapsed_time >= 100U) /* Timeout after 100 ms */
                {
                    result = CLK_OUT_RANGE; /* Timeout occurred */
                    state = MONITOR_DONE; /* Skip to done */
                }
            }
            break;
}
Tags (1)
0 Kudos
Reply
1 Solution
1,813 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

There is no strict minimum value documented for CMU_MDR, but:

Too small values (e.g., < 0x1000) may result in unstable or inaccurate measurements, especially for low-frequency clocks like SIRC.

The recommended minimum is typically ≥ 0x2000 for SIRC and ≥ 0x8000 for FIRC to ensure reliable frequency detection .

Please read carefully AN explaining the CMU:

https://www.nxp.com/docs/en/application-note/AN12080.pdf

Best regards,

Peter

View solution in original post

3 Replies
1,826 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

what is the expected time to complete the SIRC and FIRC measurement 

The CMU uses the Measurement Duration Register (CMU_MDR) to define how long the measurement should take.

This duration is specified in terms of IRCOSC clock cycles (typically 16 MHz).

The register is 20 bits wide, allowing for a maximum duration of up to 1,048,575 cycle

 

Typical Measurement Time:

If you set CMU_MDR = 0xFFFFF (maximum value), the measurement duration would be:

petervlna_0-1754475170343.pngpetervlna_0-1754475170343.png

For shorter durations (e.g., CMU_MDR = 0x10000), the time would be:

petervlna_1-1754475180207.pngpetervlna_1-1754475180207.png
Best regards,
Peter
0 Kudos
Reply
1,820 Views
AshokSubramani
Contributor III

Is there any limitation on the minimum value that can be configured in the CMU_MDR (Measurement Duration Register) for clock monitoring?

Specifically, I have configured the following measurement durations:

  • FIRC: CMU_MDR = 0x8FFF

  • SIRC: CMU_MDR = 0x2020

Are these values valid for accurate and reliable frequency measurement?
Or is there a recommended minimum threshold that should be followed to ensure stability and correctness of the measurement?

Tags (1)
0 Kudos
Reply
1,814 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

There is no strict minimum value documented for CMU_MDR, but:

Too small values (e.g., < 0x1000) may result in unstable or inaccurate measurements, especially for low-frequency clocks like SIRC.

The recommended minimum is typically ≥ 0x2000 for SIRC and ≥ 0x8000 for FIRC to ensure reliable frequency detection .

Please read carefully AN explaining the CMU:

https://www.nxp.com/docs/en/application-note/AN12080.pdf

Best regards,

Peter

%3CLINGO-SUB%20id%3D%22lingo-sub-2146877%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EClock%20Monitoring%20unit%20in%20MPC5746C%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2146877%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CDIV%3E%3CSPAN%3E%3CSPAN%3EI%20want%20to%20measure%20a%20FIRC%20%26amp%3B%20SIRC%20clock%20monitoring%20during%20runtime%2C%20if%20i%20use%20%3CSTRONG%3Ewhile%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSTRONG%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3ECMU%3C%2FSPAN%3E%3CSPAN%3E.%3C%2FSPAN%3E%3CSPAN%3ECSR%3C%2FSPAN%3E%3CSPAN%3E.%3C%2FSPAN%3E%3CSPAN%3EB%3C%2FSPAN%3E%3CSPAN%3E.%3C%2FSPAN%3E%3CSPAN%3ESFM%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3D%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B1%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%3E%3CSTRONG%3EU)%7B%7D%3C%2FSTRONG%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Emy%20execution%20has%20to%20wait%20for%20sometime%2C%20to%20avoid%20that%20i%20am%20using%20a%20logic%20to%20come%20out%20of%20the%20loop%20if%20measurement%20not%20completed%20within%20the%20time%20period%20.%20so%20what%20is%20the%20%3CSTRONG%3Eexpected%20time%20to%20complete%20the%20SIRC%20and%20FIRC%20measurement%3C%2FSTRONG%3E%26nbsp%3B%20by%20considering%20ageing%20factor%20and%20lifespan%20of%20MCU.%20Herewith%20I%20have%20added%20my%20logic%20which%20runs%20every%2010ms.%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Euint8%3C%2FSPAN%3E%20%3CSPAN%3EClock_Monitor_Runtime%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3Evoid%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%3Estatic%3C%2FSPAN%3E%20%3CSPAN%3EClockMonitorState%3C%2FSPAN%3E%20%3CSPAN%3Estate%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3EFIRC_MONITOR_INIT%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3CSPAN%3E%20%2F*%20State%20variable%20for%20both%20monitors%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%3Estatic%3C%2FSPAN%3E%20%3CSPAN%3Euint32%3C%2FSPAN%3E%20%3CSPAN%3Eelapsed_time%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E0U%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%2F*%20Time%20tracker%20for%20timeout%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%3Estatic%3C%2FSPAN%3E%20%3CSPAN%3Euint32%3C%2FSPAN%3E%20%3CSPAN%3EMeasDur%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E0U%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%2F*%20Measurement%20duration%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%3Estatic%3C%2FSPAN%3E%20%3CSPAN%3Euint8%3C%2FSPAN%3E%20%3CSPAN%3Eresult%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3ECLK_IN_RANGE%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%2F*%20Default%20result%20to%20indicate%20progress%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%3Eswitch%3C%2FSPAN%3E%3CSPAN%3E%20(%3C%2FSPAN%3E%3CSPAN%3Estate%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26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2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%3Eresult%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3ECLK_IN_RANGE%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3CSPAN%3E%20%2F*%20FIRC%20clock%20is%20within%20range%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%3Estate%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3ESIRC_MONITOR_INIT%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3CSPAN%3E%20%2F*%20Move%20to%20SIRC%20monitoring%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%3Eelse%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%3Eresult%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3ECLK_OUT_RANGE%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3CSPAN%3E%20%2F*%20FIRC%20clock%20is%20out%20of%20range%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%3Estate%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3EFIRC_MONITOR_INIT%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3CSPAN%3E%20%2F*%20Move%20to%20FIRC%20monitoring%20again%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%3Eelse%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%2F*%20Increment%20elapsed%20time%20(10%20ms%20per%20call)%20%26nbsp%3B*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%3Eelapsed_time%3C%2FSPAN%3E%20%3CSPAN%3E%2B%3D%3C%2FSPAN%3E%20%3CSPAN%3E10U%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%3Eif%3C%2FSPAN%3E%3CSPAN%3E%20(%3C%2FSPAN%3E%3CSPAN%3Eelapsed_time%3C%2FSPAN%3E%20%3CSPAN%3E%26gt%3B%3D%3C%2FSPAN%3E%20%3CSPAN%3E100U%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3CSPAN%3E%20%2F*%20Timeout%20after%20100%20ms%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%3Eresult%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3ECLK_OUT_RANGE%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3CSPAN%3E%20%2F*%20Timeout%20occurred%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%3Estate%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3EMONITOR_DONE%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3CSPAN%3E%20%2F*%20Skip%20to%20done%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%3Ebreak%3C%2FSPAN%3E%3CSPAN%3E%3B%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2148075%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Clock%20Monitoring%20unit%20in%20MPC5746C%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2148075%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%0A%3CP%3EThere%20is%26nbsp%3Bno%20strict%20minimum%20value%26nbsp%3Bdocumented%20for%20CMU_MDR%2C%20but%3A%3C%2FP%3E%0A%3CP%3EToo%20small%20values%26nbsp%3B(e.g.%2C%20%26lt%3B%26nbsp%3B0x1000)%20may%20result%20in%26nbsp%3Bunstable%20or%20inaccurate%20measurements%2C%20especially%20for%20low-frequency%20clocks%20like%20SIRC.%3C%2FP%3E%0A%3CP%3EThe%26nbsp%3Brecommended%20minimum%26nbsp%3Bis%20typically%26nbsp%3B%E2%89%A5%26nbsp%3B0x2000%26nbsp%3Bfor%20SIRC%20and%26nbsp%3B%E2%89%A5%26nbsp%3B0x8000%26nbsp%3Bfor%20FIRC%20to%20ensure%20reliable%20frequency%20detection%26nbsp%3B.%3C%2FP%3E%0A%3CP%3EPlease%20read%20carefully%20AN%20explaining%20the%20CMU%3A%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Fapplication-note%2FAN12080.pdf%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Fapplication-note%2FAN12080.pdf%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%3C%2FP%3E%0A%3CP%3EPeter%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2147602%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Clock%20Monitoring%20unit%20in%20MPC5746C%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2147602%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EIs%20there%20any%20limitation%20on%20the%20minimum%20value%20that%20can%20be%20configured%20in%20the%20%3CSTRONG%3ECMU_MDR%20(Measurement%20Duration%20Register)%3C%2FSTRONG%3E%20for%20clock%20monitoring%3F%3C%2FP%3E%3CP%3ESpecifically%2C%20I%20have%20configured%20the%20following%20measurement%20durations%3A%3C%2FP%3E%3CUL%3E%3CLI%3E%3CP%3E%3CSTRONG%3EFIRC%3C%2FSTRONG%3E%3A%20CMU_MDR%20%3D%200x8FFF%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3E%3CSTRONG%3ESIRC%3C%2FSTRONG%3E%3A%20CMU_MDR%20%3D%200x2020%3C%2FP%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3EAre%20these%20values%20valid%20for%20accurate%20and%20reliable%20frequency%20measurement%3F%3CBR%20%2F%3EOr%20is%20there%20a%20recommended%20minimum%20threshold%20that%20should%20be%20followed%20to%20ensure%20stability%20and%20correctness%20of%20the%20measurement%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2147576%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Clock%20Monitoring%20unit%20in%20MPC5746C%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2147576%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3E%3CSPAN%3Ewhat%20is%20the%20%3CSTRONG%3Eexpected%20time%20to%20complete%20the%20SIRC%20and%20FIRC%20measurement%3C%2FSTRONG%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CP%3EThe%20CMU%20uses%20the%26nbsp%3BMeasurement%20Duration%20Register%20(CMU_MDR)%26nbsp%3Bto%20define%20how%20long%20the%20measurement%20should%20take.%3C%2FP%3E%0A%3CP%3EThis%20duration%20is%20specified%20in%20terms%20of%26nbsp%3BIRCOSC%20clock%20cycles%26nbsp%3B(typically%2016%20MHz).%3C%2FP%3E%0A%3CP%3EThe%20register%20is%26nbsp%3B20%20bits%20wide%2C%20allowing%20for%20a%20maximum%20duration%20of%20up%20to%26nbsp%3B1%2C048%2C575%20cycle%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3ETypical%20Measurement%20Time%3A%3C%2FP%3E%0A%3CP%3EIf%20you%20set%26nbsp%3BCMU_MDR%20%3D%200xFFFFF%26nbsp%3B(maximum%20value)%2C%20the%20measurement%20duration%20would%20be%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22petervlna_0-1754475170343.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22petervlna_0-1754475170343.png%22%20style%3D%22width%3A%20292px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F351174i8062FEADD5DB7970%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22petervlna_0-1754475170343.png%22%20alt%3D%22petervlna_0-1754475170343.png%22%20%2F%3E%3Cspan%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3Epetervlna_0-1754475170343.png%3C%2Fspan%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EFor%20shorter%20durations%20(e.g.%2C%26nbsp%3BCMU_MDR%20%3D%200x10000)%2C%20the%20time%20would%20be%3A%3C%2FP%3E%0A%3CDIV%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22petervlna_1-1754475180207.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22petervlna_1-1754475180207.png%22%20style%3D%22width%3A%20210px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F351175iAFA23A2A15D24765%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22petervlna_1-1754475180207.png%22%20alt%3D%22petervlna_1-1754475180207.png%22%20%2F%3E%3Cspan%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3Epetervlna_1-1754475180207.png%3C%2Fspan%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3EBest%20regards%2C%3C%2FDIV%3E%0A%3CDIV%3EPeter%3C%2FDIV%3E%3C%2FLINGO-BODY%3E