Calling timer for very 1ms

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Calling timer for very 1ms

840件の閲覧回数
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 返答(返信)

826件の閲覧回数
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 件の賞賛
返信

826件の閲覧回数
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 件の賞賛
返信