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:
And there are some results:
when period = 24000 us
when period = 12000 us
when period = 1000 us
when period = 50 us
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.