IPM problem EMIOS_ic

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IPM problem EMIOS_ic

1,330 Views
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

Labels (1)
0 Kudos
4 Replies

1,301 Views
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 Kudos

1,296 Views
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 Kudos

1,279 Views
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 Kudos

1,266 Views
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 Kudos