MQX 4.2 K64F120 :Why the accuracy of hardware timer is too low

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MQX 4.2 K64F120 :Why the accuracy of hardware timer is too low

592件の閲覧回数
zzqqq
Contributor I

Hi,

I use the hwtimer in MQX ,But I  find the timer is slow than my phone timer. About  slow 4 seconds every one hour?

Can someone help me ?

Details:

I use external 8M  osc.

#define CPU_BUS_CLK_HZ 60000000U /* Initial value of the bus clock frequency in Hz */
#define CPU_CORE_CLK_HZ 120000000U /* Initial value of the core/system clock frequency in Hz. */

/* HWTIMER definitions for user applications */
#define BSP_1S_PIT_TIMER_DEV pit_devif
#define BSP_1STIMER_SOURCE_CLK (CM_CLOCK_SOURCE_BUS)
#define BSP_1S_PIT_TIMER_ID (0)

The period is 1 second, and I add a counter to count the seconds in the callback function.

タグ(2)
0 件の賞賛
返信
1 返信

506件の閲覧回数
danielchen
NXP TechSupport
NXP TechSupport

Hi zqq:

Could you let us know your clock mode , FLL or PLL?

How many tasks in your system,  do you have other tasks ?

Actually we have hwtimer demo in MQX installation folder, you can use it for reference.

C:\Freescale\Freescale_MQX_4_2\mqx\examples\hwtimer

Regards

Daniel

0 件の賞賛
返信