This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Regarding TIMER in LPC1788

Good noon every one.

Right now am dealing with TIEMR0 of LPC1788. In that case , am trying to make 1 second delay
using TIMER0 peripheral. For that process i have select 1 MHz freq for PCLK, 1000000 for MR0 register, 0 for PR register but i cant get exact delay for this one . i got nearly 2 second delay. I have attached TIMER0 config code here.

   LPC_SC->PCONP |=(1<<1);                    // select power for timer

   LPC_SC->CLKSRCSEL |=(1<<0);        // select external OSC

   LPC_SC->CCLKSEL &=~(1<<8);     // select sys clk as a CPU clk

   LPC_SC->CCLKSEL |= 1<<0;           // for 12 MHz freq

   LPC_SC->PCLKSEL =0x0C;                   // for 1MHz freq
   LPC_TIM0->MR0 |=(1000000<<0);

   LPC_TIM0->MCR |=(3<<0);
   LPC_TIM0->TCR |=(1<<1);

   LPC_TIM0->TCR &=~(1<<1);

   LPC_TIM0->TCR |=(1<<0);

   NVIC_EnableIRQ(TIMER0_IRQn);

Give some idea to get these ..... output

0