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.
Hi All
I am using the LPC2378 kit with 16MHz crystal running,I want 1sec delay to generate but i don't know wt value to feed into T0MR0 register,The development board which runs on 12MHz crystal where they have given 1msec = 12000-1 at 12.0 MHz , T0MR0 = 11999 so does it has a standard formula to load the value into the MR0 register does any one have any data sheet or reference to tel me wt value to be loaded depending on the crystal and the user requirement
Regards Suresh
Hello Suresh Kumar,
Please find the user manuel for the LPC2378 under www.standardics.nxp.com/.../
The LPC23xx timers are on the Advanced Peripheral Bus (APB). Therefore the value for the MR0 register depends on the APB clock.
Please see Chapter 4: Clocking and power control in the user manual.
Best Regards, Martin Guenther
Hi
I went through the data sheet but there nothing was related to the timer ....can any one help me to provide me the value to load into the TxMR0 register for generating 1 sec delay if the main oscillator is 16MHz and PLL is 384MHz,cclk is 64MHz PCLK is 16MHz
PCLK is the clock used for APB Peripherals (see fig. 9 in the user manual). If PCLK is 16MHz than set the prescaler register (TxPR) to (1000-1). Due to that the timer runs on 16kHz. Than set the match register (MRx) to (16000-1) and the timer will tick every second.
hi
if i am setting the value of TxPR as 0 then wt wil be the value of TXMRO, since i have used it i wanted to know can ulet me know wt wil be the value to be loaded
if you want to set the prescaler register value to 0 than you have to set the value of TxMR0 to (16000000-1). If this does not fit into the register than reduce PCLK. ;-)
Did you download the User Manual, and not just the Datasheet? There is a lot of info availble about how to configure the timers.
yes i downloaded the user manual but there's not given how to calculate the timer value like in atmel the formula is given to calculate the timer value similarlly its not given in the LPC... do LPC has any application notes on the timer
In fact, there is a whole page on the NXP site dedicated to the LPC2378 - with Datasheet, User Manual, Errata, Application Notes, etc:
www.nxp.com/.../LPC2378.html
hi all
this is how i initialize the timer1 void init_timer1(void){ T1MR1 = 15999999;//15990; T1MCR = 3; T1TCR = 1; T1CTCR = 0x00; VICVectAddr5 = (unsigned long)T1_IRQHandler; VICVectCntl5 = 14; VICIntEnable = (1 << 5); }
__irq void T1_IRQHandler (void) { volatile unsigned int pin_status; pin_status = FIO4PIN;
if((pin_status & 0x20000000) == 0x20000000) { FIO4CLR |= 0x20000000; } else { FIO4SET |= 0x20000000; } }
this timer1 is not working in timer0 and timer1 i have initialized as similar which toggles the pin every one sec.here timer0 generates the interrupt and i get the pin toggled but i have the problem with timer1 the pin doesnt toggle so i doubt tht timer1 is not initialized or its not able to generate interrupt so can any one help me to rectify the doubt i have given the code how i initialize the time and the interrupt code ...the default PCONP is set .
Regards suresh
www.danlhenry.com/.../keil_code.png