Abnormal period values when using eMIOS IPM mode

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

Abnormal period values when using eMIOS IPM mode

2,841 次查看
sx
Contributor III

Hi,

I want to use 5748G to control a pwm fan . And i configured an eMIOS channel as IPM mode to measure the fan's speed. Sadly the period calculated by the IPM seems not quite right. I found someabnormal values, and the longer the period is, the more abnormal values are. So please help me to fix it.

There are some codes from my application:

IPM-7.PNG

IPM-8.PNG

And there are some results: 

when period = 24000 us

IPM-1.PNG

when period = 12000 us

IPM-2.PNG

when period = 1000 us

IPM-4.PNG

when period = 50 us

IPM-3.PNG

标签 (1)
标记 (3)
5 回复数

2,727 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

the eMIOS contains a 16bit counter on MPC5748G. So if you use 100000 (0x186A0) as boundary for Counter Bus A, then a time base is counting up to 0x86A0 (34464) only.

If you will use 34464 as MAXCNT in your calculation, you got right period values.

BR, Petr 

2,727 次查看
sx
Contributor III

Another question: How can i calculate the period if there are several overflows? Or how can i determine the number of overflows?

0 项奖励
回复

2,727 次查看
PetrS
NXP TechSupport
NXP TechSupport

you can enable interrupt for channel 23 and increment some global variable indicating oveflows. Then use this variable value within period calculation.

BR, Petr

0 项奖励
回复

2,727 次查看
sx
Contributor III

Ok, thanks for your help!

0 项奖励
回复

2,727 次查看
sx
Contributor III

Oh, i forgot this, thanks!

0 项奖励
回复