AN2897
Rev. 0, 11/2004
Freescale Semiconductor
Application Note
Using the eTPU Angle Clock
by: Mike Pauwels
TECD Systems Applications Engineering
Table of Contents
This document describes the Angle Clock feature of the
Enhanced Time Processor Unit and offers practical
advise on the application and use of this feature. The note
assumes a familiarity with the eTPU and the eTPU_C
language used in the Byte Craft compiler. Code
examples presented below are taken from a Reference
design which is available from your Freescale
representative.
1
2
Overview .............................................................1
eTPU Angle Clock Hardware.............................3
2.1 Tooth Wheel Input..............................................5
2.2 Tick Counter ......................................................5
2.3 Missing Teeth.....................................................6
2.4 Zero Count Synchronization..............................7
2.5 Error Recovery ....................................................7
3
System Design ....................................................8
3.1 Steady State System Design.............................9
3.2 Acceleration and Deceleration.........................11
3.3 Startup System Design....................................13
3.4 Anomalies........................................................15
3.5 Tooth Circuit Failure.........................................18
1 Overview
The Enhanced Time Processor Unit (eTPU) is an
autonomous slave processor offered on various families
of Freescale microcontrollers. The processor is tightly
coupled to up to 32 channels, each associated with an
input and an output signal. The input/output channels
each have a pair of Match and Capture units interfaced to
one of two timer/counter (TCR) registers. Logic in the
channel enabled the hardware to detect or drive pin
transitions with a high degree of timing precision.
4
eTPU Software Design....................................18
4.1 Host Setup.......................................................18
4.2 State Machine Description...............................19
5
5.1 Free Running Angle Counter...........................27
5.2 Periodic Angle Clock........................................28
5.3 Angle Math ......................................................28
Angle Clock Application...................................27
6
Summary...........................................................29
In a typical application, at least one of the TCRs is driven
by a real time clock derived from the MCU clock
frequency. The second TCR can be driven by an
© Freescale Semiconductor, Inc., 2004. All rights reserved.