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:
And there are some results:
when period = 24000 us
when period = 12000 us
when period = 1000 us
when period = 50 us
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
Another question: How can i calculate the period if there are several overflows? Or how can i determine the number of overflows?
you can enable interrupt for channel 23 and increment some global variable indicating oveflows. Then use this variable value within period calculation.
BR, Petr
Ok, thanks for your help!
Oh, i forgot this, thanks!