MPC5748G- STM

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

MPC5748G- STM

1,542 次查看
SKC123
Contributor I

Hi

I am using MPC5748G SDK driver. I want time in millisecond using STM. Also I want  calculation. Also there is any other timer to give the time in millisecond .Please guide me.

Thank and regards

SKC123

 

0 项奖励
回复
1 回复

1,533 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

STM or PIT should be good choice for this.

PIT already has an option to read current value of the timer either in tick count or in microseconds. For example, there are functions like:

PIT_DRV_GetCurrentTimerCount

or

PIT_DRV_GetCurrentTimerUs

STM then has function STM_DRV_ComputeTicksByUs.

Or you can easily calculate the time like this: you know the source clock of a timer. One tick takes 1 / f_source_clock. And if you know the number of ticks, you can calculate the time as (1 / f_source_clock)*number_of_ticks.

Regards,

Lukas

0 项奖励
回复