SysTick Timer

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

SysTick Timer

5,566 次查看
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 项奖励
回复
3 回复数

2,737 次查看
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 项奖励
回复

2,737 次查看
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 项奖励
回复

2,737 次查看
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 项奖励
回复