Calculating Timer

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

Calculating Timer

309 Views
lpcware
NXP Employee
NXP Employee
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?
0 Kudos
Reply
1 Reply

296 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Marius05 on Fri Oct 07 10:31:35 MST 2011
My fault.
The Code had some problems. Calculation was exactly correct.
0 Kudos
Reply