AN2848 Freescale Semiconductor / Motorola, AN2848 Datasheet - Page 6

no-image

AN2848

Manufacturer Part Number
AN2848
Description
Programming the eTPU
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Function Design – Hardware
systems implemented. Along the way, a number of difficult problems posed by the unique nature of the
eTPU have been discovered and solved. This application note contains some of the wisdom of prior
experience for the benefit of new engineers.
3
The first step in applying the eTPU to a timing and control problem is to determine if the application fits
within the capabilities of the eTPU. To do this requires a working understanding of the architecture of the
timing channels. A detailed treatment of this will be covered in another application note, but here is a
summary of the general capabilities and limitations of the channel hardware:
6
RESOLUTION – The channel hardware can set a pin high or low, or toggle it immediately or at
some time in the future. This occurs when a free running counter/timer matches a register value.
The size of the register is 24 bits, and the counter can be incremented as fast as ½ the frequency of
MCU system clock. This is the finest resolution available for timing.
MAXIMUM TIME – The timer/counter can be slowed by prescaling, and the TCR range is 24
bits. If the TCR resolution is 100 nanoseconds, then the counter range is about 1.67 seconds.
More significantly, signal timing can incorporate software counters, enabling virtually any
maximum time length.
MINIMUM TIME – The channel has two match comparators, and a pulse can be set to start at one
time and end at another after only a single tick of the selected counter/timer. Thus, the minimum
time pulse that can be produced is 2 times the system clock.
INPUT LIMITS – The above limits are virtually the same for input transition measurements.
TIME BASES – While there are two time bases provided, the range of one counter is sufficient to
enable virtually any combination of pulse times. The second one can be driven by an
asynchronous external source, or be controlled by special Angle Clock circuitry provided in the
eTPU. The Angle Clock is a subject of a future note, but in general it is a system where the angle
of a spinning shaft can be tracked and the extrapolated angle can be used to time input or output
events.
INTERACTION OF EVENTS – The channel hardware can be configured into a number of
operating modes, where, for example, output pulses can be timed by two different time bases,
input pulses windowed by timers, or outputs can be used to enable timers all without direct
software intervention.
SYNCHRONIZATION – Since all channels operate from the same timer/counters, software can
be used to synchronize inputs and outputs with quite complicated algorithms. For example, a
spark pulse can be made to start at a projected time before the firing angle, and fire exactly on the
angle, tracking as closely as possible the variation in speed of an engine.
LATENCY – Since the channels have only two action units for each pin, the eTPU requires
software intervention before a third transition can be acted upon. This means that while it is
possible to accurately produce or measure a narrow single pulse, a third transition can only be
produced or detected after the eTPU engine has begun to service the channel. The minimum time
Function Design – Hardware
Programming the eTPU, Rev. 0
Freescale Semiconductor

Related parts for AN2848