System design
AN2577
Example
Assume a TCR1 time of 100 nanoseconds, a maximum speed of 10,000 RPM and a 36
tooth (10 degree) wheel,
1 *MaxTicks < DegreesPerTooth * TRC1_Frequency / (60 * RPM_Maximum)
MaxTicks < 1 * 10.0 * 10,000,000 / 60 * 10,000 = 166. ticks per tooth
Assume a TCR1 time of 100 nanoseconds, a minimum speed of 20 RPM and a 36
tooth (10 degree) wheel,
32768 * MinTicks > DegreesPerTooth * TRC1_Frequency / (60 * RPM_Minimum)
MinTicks > 10.0 * 10,000,000 / (60 * 20 * 32768) = 2.543 ticks per tooth
3.1.4
3.1.5
3.1.6
choose 100 for 10 ticks per degree (0.1 degree per tick)
Reference point
The reference point for a periodic angle clock should be on a selected physical tooth edge.
Typically this might be the first tooth edge after the gap, but any edge can be chosen. Note
that if the angle clock is to cycle through 720 degrees rotation, the resetting tooth is found on
alternate rotations of the wheel. Selecting an absolute reference for the 720 degree cycle
must be done using an external reference such as a cam shaft sensor.
The angle clock will automatically reset to zero if a physical tooth edge is detected with the
LAST bit set in the TPR. This means that the system software must keep track of the tooth
count and write the LAST bit at the appropriate time.
Missing teeth
In an automotive engine control system, the toothed wheel on the crankshaft typically has
one or more missing teeth to provide an angular reference point. The angle clock hardware
can provide compensation for these missing teeth, adding a tooth count and repeating the
tick count for each missing tooth to bridge the gap in the teeth. The system software must
keep track of the tooth count and, after the last edge before the gap, write the number of
expected missing teeth to the MISSCNT field in the TPR.
Tick rate
The eTPU can automatically record the time of a tooth transition on the Channel 0 input. If
the software has stored the previous edge time, then the period of the tooth signal can be
calculated by subtracting the times. To derive the value for the TRR, the software must
divide the time for a tooth period by the number of ticks per tooth. This calculation must be
adjusted if the most recent period was measured over the gap.
Note that the tooth period is a measure of the rotational speed of the engine. Typically this
value is kept in a global memory location. In that case, it should be updated with the
adjusted period when measured over the gap.
3.2
Acceleration and deceleration
Speed changes in the wheel can be easily handled by the eTPU angle clock hardware if it is
properly managed by the eTPU software. Since the tick counter is an extrapolation of the
14/34