kb1gtt wrote: Also the FS provided code is only for wheels like a 36-1, and does not support 36-1-2 or any other wheel.
FS just updated the crank eTPU code recently. I haven't dug into it much at this point, but it does state that it supports user defined tooth patterns. from
AN3769:
Support for wide range tooth wheel configurations
- Up to 255 teeth on the wheel are supported
- Between 1 and 3 missing teeth are supported
From
AN4907 (the new application note on the new engine control set:
"The original Automotive eTPU Function Set, called set2, was released as AN3768 and AN3768SW at
http://www.freescale.com in 2009. It consists of five eTPU functions.
• Crank and Cam (together as Engine Position driver)
• Fuel
• Spark
• Knock Window
• Tooth Generator (for testing only)
These functions were capable of driving port injection engines. Modern direct injection engines were not supported. Also, the
range of supported crank & cam patterns was limited.
The new Engine Control eTPU Library overcomes these limitations. It aims to serve as ready to use functions for automotive
applications. Moreover, it brings the eTPU code for developers to make them understand or even to modify the code for their
specific needs.
The new Crank and Cam eTPU functions are generally able to synchronize to any crank and cam signal pattern. A crank
wheel with multiple gaps, with an additional tooth instead of a gap, and also multiple cam signals are supported.
The new eTPU function Direct Injection is dedicated to direct solenoid injection drive. The function is able to generate a
pattern of synchronous angle or time based output pulses on several output channels, including common bank channels and
individual injector channels. For a closed loop solenoid current control, this function can provide the timing for either an
external (MC33816) or internal (Reaction Channel) closed loop logic.
The updated functions of Fuel, Spark, and Knock Window are ported to new coding style, which is MISRA compliant, easy
to read, reuse, and modify. The functionality is slightly extended from the original set2 versions."
I haven't dug into using these functions yet. This micro is a
long way from the 8-bit AVRs I usually play with, so right now I am working on making a bunch of LEDs flash using the eTPU on my TRK board. But, you might want to look into the new set before you write off the engine control eTPU code.
Clint