Calling timer for very 1ms

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

Calling timer for very 1ms

832 Views
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 Kudos
Reply
2 Replies

818 Views
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 Kudos
Reply

818 Views
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 Kudos
Reply