Hallo,
I'm working with the S32K144 Evaluation Board, MPC338xxx Evaluation Board and MBT.
I'm attempting to determine the time between the teeth on a flywheel (Teeth: 9 existing + 3 missing) from the crankshaft speed sensor. To achieve this I'm using the FTM-Input Edge Capture Block. For my model validation I'm also measuring the voltage from the crankshaft speed sensor using ADC.
Sam_ECU_0-1627226951343.png
Within Freemaster I can see that the signal from the sensor is good and that the TimeStamp triggered by the FTM aligns perfectly with the voltage signal generated from the tooth.
Sam_ECU_4-1627227665822.png
My problem though, is that the counter values I receive from the FTM don't make sense in regards to time. 9 of the teeth are equally separated, but the counter values for each of the teeth can vary widely.
Reading the documentation and reviewing the code from Simulink, the FTM-Clock appears to be SYS_CLK = 80 MHz.
Sam_ECU_2-1627227550593.png
Sam_ECU_3-1627227586823.png
The flywheel is rotating at 750rpm
750 rpm --> 13Hz --> 0,077 seconds per revolution
I have a prescale factor of 128. Therefore I believe my Clock is 625 kHz and that the counter isn't overflowing.
Sam_ECU_5-1627228075579.png
I'm stuck and would appreciate any help. I've attached a measurement file from Freemaster. In the file the timing from the board aligns with the rising edges, but the timestamp (ticks) don't correlate.
Additional question, can I change the source clock for the FTM in MBT?
If not, how can? Are the examples somewhere?
Is there a way to incorporate a counter for when the counter overflows?
Thanks for any help, it's much appreciated.