Calling timer for very 1ms

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

Calling timer for very 1ms

859 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mahalinr on Mon Jan 27 01:45:10 MST 2014
Hallo

               I need to call an function for every 1ms using a timer.Please telll me how to program that in C
0 项奖励
回复
2 回复数

845 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LabRat on Mon Jan 27 04:36:31 MST 2014
:quest:
//set systick
SysTick_Config(SystemCoreClock / 1000);

//set flag
//SysTick
void SysTick_Handler(void) //Interrupt handler
{
 flag =1;
}

//call function
if(flag)
{
 flag =0;
 call_function();
}


0 项奖励
回复

845 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Mon Jan 27 02:38:39 MST 2014
Search the forums for "1ms timer" - there are several threads. For example
http://www.lpcware.com/content/forum/1-micro-sec-timer
0 项奖励
回复