We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
We are trying to develop the nano seconds delay but ended up with 1 us delay minimum.
init_timer()
{
LPC_SC->PCONP |= (1<<SBIT_TIMER0) | (1<<SBIT_TIMER1); /* Power ON Timer0,1 */
LPC_TIM0->MCR = (1<<SBIT_MR0I) | (1<<SBIT_MR0R); /* Clear TC on MR0 match and Generate Interrupt*/LPC_TIM0->PR = 0;//LPC_TIM0->MR0 = 10;//LPC_TIM0->TCR = (1 <<SBIT_CNTEN); /* Start timer by setting the Counter Enable*/NVIC_EnableIRQ(TIMER0_IRQn);
}
void TIMER0_IRQHandler(void){unsigned int isrMask;
isrMask = LPC_TIM0->IR;LPC_TIM0->IR = isrMask; /* Clear the Interrupt Bit */
LPC_GPIO0->FIOPIN ^= (1<<LED1); /* Toggle the LED1 (P2_0) */}
Keil CMSIS-RTOS docu confirming "millisec" time delay value:
www.keil.com/.../group__CMSIS__RTOS__Wait.html