5 Using UTMR as Signal Measurement Timer (SMT)

SMT is a 24-bit counter with advanced clock and gating logic, which can be configured for measuring a variety of digital signal parameters, such as pulse width, frequency and duty cycle, and the time difference between edges on two signals. A key feature that differentiates SMT from UTMR is the presence of two input signals (SMT signal and window) and two capture registers (SMTxCPW and SMTxCPR). UTMR has only one input signal (ERS) and one capture register. Thus, the UTMR might need to be reconfigured multiple times to measure different attributes in the same application. The following table shows UTMR settings in different SMT modes:

Table 5-1. UTMR Settings for Different SMT Modes

SMT MODE[3:0]

SMT ModeUTMR SettingsComments
STARTRESETSTOPOther
0000TimerNone (ON = 1)At PR MatchNone
0001Gated TimerRising ERS EdgeAt PR MatchEither ERS EdgeUse SMT signal as ERS input.
0010Period and Duty Cycle MeasurementRising ERS EdgeAt Start + PR Match

None (measures pulse-width)

Rising ERS Edge (measures period)

Use SMT signal as ERS input. TUxyCR capture register will capture either pulse-width or period based on the Stop condition, but not both simultaneously.
0011High and low time MeasurementEither ERS EdgeAt Start + PR MatchEither ERS EdgeUse SMT signal as ERS input. TUxyCR capture register will capture high time, then low time, then high time, and so on. TUxyCR must be read before it is overwritten with new data.
Rising ERS EdgeAt Start + PR MatchEither ERS Edge

EPOL = True level for high time

EPOL = Inverted level for low time

Use SMT signal as ERS input. TUxyCR capture register will capture either high time or low time based on EPOL bit setting.
0100Windowed MeasurementRising ERS EdgeAt Start + PR MatchRising ERS EdgeUse SMT window as ERS input.TUxyCR capture register will capture period of the window signal.
0101Gated Windowed MeasurementRising ERS EdgeAt PR MatchEither ERS EdgeUse SMT signal as ERS input. Use software to poll SMT window signal and reset counter manually using CLR command at every rising edge. Alternatively, interrupt-on-change can be used to monitor SMT window signal in software.
0110Time of Flight MeasurementRising ERS EdgeAt Start + PR MatchEither ERS EdgeUse CLC to send an XOR of SMT window and SMT signal via ERS. TUxyCR capture register captures the time of flight measurement.
0111CaptureNoneAt PR MatchEither ERS EdgeUse SMT signal as ERS input. TUxyCR capture register will first capture rising edge of ERS, then the falling edge of ERS, then the rising edge, and so on. TUxyCR must be read before it is overwritten with new data. PRAIF and PWAIF are both captured via CIF.
1000CounterNone (ON = 1)At PR MatchNone

CSYNC = Async for using external clock source

EPOL = Inverted for capturing at rising edge of ERS

Use SMT signal as UTMR clock input. Use SMT window as ERS input. TUxyCR capture register will capture counter value at falling edge of ERS (or rising edge when EPOL = Inverted).
1001Gated CounterRising ERS EdgeAt PR MatchEither ERS EdgeCSYNC = Async for using external clock sourceUse SMT signal as UTMR clock input. Use SMT window as ERS input. TUxyCR capture register will capture counter value at falling edge of ERS. PWAIF is equivalent to CIF.
1010Windowed CounterRising ERS EdgeAt Start + PR Match

None (measures pulse-width)

Rising ERS Edge (measures period)

CSYNC = Async for using external clock sourceUse SMT signal as UTMR clock input. Use SMT window as ERS input. TUxyCR capture register will capture either pulse-width or period based on the Stop condition, but not both simultaneously.