User Manual
480
Rev. 1.1
2019-03-18
TLE984xQX
Microcontroller with LIN and Power Switches for Automotive Applications
General Purpose Timer Units (GPT12)
Note:
The underflow signal of Timer T6 can furthermore be used to clock one or more of the timers of the
CAPCOM units, which gives the user the possibility to set compare events based on a finer resolution
than that of the external events. This connection is accomplished via signal T6OUF.
Capture Correction
A certain deviation of the output frequency is generated by the fact that timer T5 will count actual time units
(e.g. T5 running at 1 MHz will count up to the value 64
H
/100
D
for a 10 kHz input signal), while T6OTL will only
toggle upon an underflow of T6 (i.e. the transition from 0000
H
to FFFF
H
). In the above mentioned example, T6
would count down from 64
H
, so the underflow would occur after 101 timing ticks of T6. The actual output
frequency then is 79.2 kHz, instead of the expected 80 kHz.
This deviation can be compensated for by using T6 overflows. In this case, T5 counts down and T6 counts up.
Upon a signal transition on pin CAPIN, the count value in T5 is captured into CAPREL and T5 is cleared to 0000
H
.
In its next clock cycle, T5 underflows to FFFF
H
, and continues to count down with the following clocks. T6 is
reloaded from CAPREL upon an overflow, and continues to count up with its following clock cycles (8 times
faster in the above example). In this case, T5 and T6 count the same number of steps with their respective
internal count frequency.
In the above example, T5 running at 1 MHz will count down to the value FF9C
H
/-100
D
for a 10 kHz input signal
applied at CAPIN, while T6 counts up from FF9C
H
through FFFF
H
to 0000
H
. So the overflow occurs after 100
timing ticks of T6, and the actual output frequency at T6OUT then is the expected 80 kHz.
However, in this case CAPREL does not directly contain the time between two CAPIN events, but rather its 2's
complement. Software will have to convert this value, if it is required for the operation.
Combined Capture Modes
For incremental interface applications in particular, several timer features can be combined to obtain
dynamic information such as speed, acceleration, or deceleration. The current position itself can be obtained
directly from the timer register (T2, T3, T4).
The time information to determine the dynamic parameters is generated by capturing the contents of the free-
running timer T5 into register CAPREL. Two trigger sources for this event can be selected:
• Capture trigger on sensor signal transitions
• Capture trigger on position read operations
Capturing on sensor signal transitions is available for timer T3 inputs. This mode is selected by setting bit CT3
and selecting the intended signal(s) via bitfield CI in register T5CON. CAPREL then indicates the time between
two selected transitions (measured in T5 counts).
Capturing on position read operations is available for timers T2, T3, and T4. This mode is selected by clearing
bit CT3 and selecting the rising edge via bitfield CI in register T5CON. Bitfield ISCAPIN in register PISEL then
selects either a read access from T3 or a read access from any of T2 or T3 or T4. CAPREL then indicates the time
between two read accesses.
These operating modes directly support the measurement of position and rotational speed. Acceleration and
deceleration can then be determined by evaluating subsequent speed measurements.