Calculating Timer

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Calculating Timer

205 次查看
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 项奖励
1 回复

192 次查看
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 项奖励