Content originally posted in LPCWare by Marius05 on Fri Oct 07 09:56:26 MST 2011
Hello,
I have some Problem with calculating the right timer frequency.
I am using the LPC-Xpresso1769 Rev B
My Clock should be 100 MHz
#define PLL0CFG_Val 0x00050063
#define CCLKCFG_Val 0x00000003
The clock division is 4
#define PCLKSEL0_Val 0x00000000
So the timer clock should run with 25 MHz
But if I enable my timer
init_timer(0,25000000-1);
It runs to slow.
Actually I have to reduze the the timer down to 23500000 to get arround 1 sek per overflow.
What is wrong in my calculation?