Systick timer problem of KEA8

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

Systick timer problem of KEA8

1,303 Views
623619261
Contributor I

I have a strange problem with kea8.It 

  • My core clock is FEI mode ,48Mhz,and bus clock is 24Mhz.And configure code as below:

ICS_C2 = 0x20; 
ICS_C1 = 0x04; 
while ((ICS_S & ICS_S_LOCK_MASK) == 0); 
SIM_CLKDIV = 0x01100000;
ICS_C2 = 0x00; 

  • I use systick to make a 1ms interrupt.And configure code as below:

/*!Comment:Set the systick timer as 1ms.*/
SYST_RVR = 48000u;

/*!Comment:set systick source clock.*/
SYST_CSR |= (1 << 2);

/*!Comment:Enable systick.*/
SYST_CSR |= (1 << 0);

/*!Comment:Enable interrupt.*/
SYST_CSR |= (1 << 1);

void SysTick_Handler(void)
{

   /*!Comment:Catch the first time entering interrupt.*/
    GPIOA_PTOR |= (1 << 13u);
}

  • The GPIO is correctly configured.When I power on the device ,It delay about 120ms to enter the first interrupt handle function "SysTick_Handler".If I use PIT module instead of systick,the delay time will decreace to 20~30ms.

I want to fix the delay time of systick timer?I use other chip like kea64 FEE mode with systick timer will not have this problem,it delay 20~30ms,too.

I want to know the minimal time to initialize clock FEI and FEE mode(KEA8 KEA64) .

Tags (4)
0 Kudos
6 Replies

1,147 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello Chari Zhou,

Let me know if I understand correctly, you're presenting a problem of a delay present in the systick that is not present if you use other timers like the LPIT but this only happens when you use the internal oscillator but with the external one doesn't happen in the KEA64, am I correct?

Does this also happen using the FEE mode in the KEA8 or only with the FEI?

Best Regards,

Alexis Andalon

0 Kudos

1,147 Views
623619261
Contributor I

Hello Alexis,

  You understand correctly!But I only find this problem using KEA8 in FEI mode.I think FEE mode works correctly because I did not find the similar problem before.

Best Regards!

0 Kudos

1,147 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello Charl,

Can you let me know how are you measuring this time? And also, could you try enabling the PIT and the Systick at the same time and check if the same delay appears?

Best Regards,

Alexis Andalon

0 Kudos

1,147 Views
623619261
Contributor I

Hello Alexis,

  • And also, could you try enabling the PIT and the Systick at the same time and check if the same delay appears?

Only the systick timer has this problem!

 

Best Regards!

Charl

0 Kudos

1,147 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello Charl,

I tried to replicate this in the TRK-KEA8 but I couldn't do it, in my test the signals are shifted by some microseconds, this is the signals that I capture and as you see there isn't any perceptive delay:

pastedImage_1.png

The delay is around 13 us between the two signals:

pastedImage_2.pngYou can check my code below. This is using the S32 Design Studio IDE.

Best Regards,
Alexis Andalon

0 Kudos

1,147 Views
623619261
Contributor I

Hello Alexis,

1. Can you let me know how are you measuring this time? 

I do this by measuring the GPIO.I set PTB4 at the end of initialize code and toggle PTB4 in the systick timer interrupt handle function.

2. And also, could you try enabling the PIT and the Systick at the same time and check if the same delay appears?

OK,I will try this on work day.

Best Regards!

Charl

0 Kudos