IPM problem EMIOS_ic

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

IPM problem EMIOS_ic

1,708件の閲覧回数
joãopaulo
Contributor III

Hello,

I'm using the DEVKIT-MPC5748G, S32Design and processor expert.

I'd like to measure the period of a square wave, then I configured EMIOS_IC component and it is working.

The problem happens when the period is too big, in my case I set the max counter value to 65535 and the clock frequency to 62500 (using prescalers) consequently I can measure periods up to 1.05 sec, when the period is higher than that I got the wrong measurement.

For example if the period is 1.5 sec then I'd need 93750 counter ticks, but the number I got from EMIOS_DRV_IC_GetLastMeasurement is 28215 what looks like to be 93750 - 65535.

What should I do to solve this problem, the EMIOS_DRV_IC_GetLastMeasurement is not returning STATUS_EMIOS_CNT_BUS_OVERFLOW... If I knew when happend the conter overflow I could handle this in my code.

 

Thanks in advance,

Regards

João Paulo

ラベル(1)
0 件の賞賛
返信
4 返答(返信)

1,679件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

 

without overflow counting you have only option to increase counter prescaler.

To count overflows you can enable interrupt for used counter bus channel (probably ch23) and increment variable in it. But then there is a question how to align this overflow value with captured values in the IC channel. 

 

BR, Petr

0 件の賞賛
返信

1,674件の閲覧回数
joãopaulo
Contributor III

Hello,

 

Isn't there a reason for EMIOS_DRV_IC_GetLastMeasurement function does not return STATUS_EMIOS_CNT_BUS_OVERFLOW when an overflow occurs?

My application is a wheel speed sensor and I need to know when the wheel is stopped.

 

Regards,

João Paulo

0 件の賞賛
返信

1,657件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

 

there is no direct support for it in HW, so driver does not have it too.

 

BR, Petr

0 件の賞賛
返信

1,644件の閲覧回数
joãopaulo
Contributor III

Hi,

The output signal of the sensor is a square wave... and there is the IPM driver to measure the period of square wave.

Why EMIOS_DRV_IC_GetLastMeasurement function does not return STATUS_EMIOS_CNT_BUS_OVERFLOW? Is it a bug?

Thanks

0 件の賞賛
返信