AnsweredAssumed Answered

S32K144 clock frequency question

Question asked by asd046012@163.com on Dec 19, 2019
Latest reply on Jan 8, 2020 by asd046012@163.com

Hello  

    

     I use the processor expert to config the working frequency of  MCU S32K144,and configured as below:use external 8MHz clock.then called the API to initial the clock as below:

 

void Clock_Init(void)
{
    CLOCK_SYS_Init(g_clockManConfigsArr,1,g_clockManCallbacksArr,0);
   /** in function CLOCK_SYS_UpdateConfiguration have set
   ** system clock,periperal clock,low power clock and power mode control .
   **/
    CLOCK_SYS_UpdateConfiguration(0,CLOCK_MANAGER_POLICY_AGREEMENT);
}

 after I initial the clock module,and write a test program to verfity the expected clock.the test program is as below:

 

void Delay_ns(void)
{
    __asm("nop");
    __asm("nop");
    __asm("nop");
    __asm("nop"); 
   __asm("nop");
  __asm("nop");
  __asm("nop");
  __asm("nop");
}

 

void Delay_us(void)
{
    PINS_DRV_SetPins(PTD,0x00000020);
    Delay_ns();
    Delay_ns();
    Delay_ns();
    Delay_ns();
    Delay_ns();
    Delay_ns();
    Delay_ns();
   Delay_ns();
   PINS_DRV_ClearPins(PTD,0x00000020);
}

according to the clock configuration,the expected running time of test program is 1us,but the measured running time is 4us,and I check the running mode of MCU S32K144,the mode is RUN mode,and use  SPLL_CLK as main clock.I don't understand why,could you give me any advice?  

 

Outcomes