SysTick Timer

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

SysTick Timer

4,264 Views
ignisuti
Contributor IV

The following was pulled from the K10 Manual. It mentions NOREF and TENMS bits of the SysTick Calibrattion Value Register, but I can't find this register in the documentation. 

 

3.2.1.2 System Tick TimerThe System Tick Timer's clock source is always the core clock, FCLK. This results in thefollowing:• The CLKSOURCE bit in SysTick Control and Status register is always set to selectthe core clock.• Because the timing reference (FCLK) is a variable frequency, the TENMS bit in theSysTick Calibration Value Register is always zero.• The NOREF bit in SysTick Calibration Value Register is always set, implying thatFCLK is the only available source of reference timing.

 

0 Kudos
3 Replies

1,435 Views
konrada
Contributor IV

The Systick is a core Cortex-M4 feature; it is documented in the "Cortex-M4 Devices Generic User Guide" which you can download from ARM; the Freescale manual only documents the deviations from the ARM manual at that point.

 

HTH

KA 

0 Kudos

1,435 Views
Amit_Kumar1
Senior Contributor II

Hi Konrad

I have gone through the documentation in ARM manual. Presently I am coding through Code warrior with Processor expert I have initialized the Systick but I dont know how to implement it in my main code. I am using TWR-K20D50M development board. I just want to use it as a delay for toggling an LED like

int main()

{

LED_ON;

delay();

LED_OFF;

delay();

}

as simple as that. but the delay which I wanted is in ms or us with some exact values like in AVR uc we have delay_ms(100); or delay_us(100); somewhat like this I am looking for .  This is the Init code generated by Processor Expert.

void SysTick_Init(void)

{

  SYST_CSR = 0x00U;                                  

 

  SYST_RVR = SysTick_RVR_RELOAD(0x00632EA0);                                  

 

  SYST_CVR = SysTick_CVR_CURRENT(0x00);                                  

  SYST_CSR = (SysTick_CSR_CLKSOURCE_MASK | SysTick_CSR_ENABLE_MASK);                                  

}

Thanks & regards

Amit Kumar

0 Kudos

1,435 Views
mehdikarimibiuk
Contributor V

I have a similar question. I need to toggle PTE0 for 1us. Is it possible to use systick to toggle PTE0 for 1us?

0 Kudos