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
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
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
Hi,
there is no direct support for it in HW, so driver does not have it too.
BR, Petr
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