3 Using UTMR as Timer 1 (TMR1) with Gate Control

TMR1 is a 16-bit timer which adds gate control features to the timer functionality. To implement the same gate control features in UTMR, the ERS signal acts as the gate. The Start and Stop conditions are tied to specific ERS events which signify the gate start and completion events, respectively. At every gate completion event (Stop condition), the current timer value is captured into the TUxyCR capture register and CIF capture interrupt occurs. The following table shows UTMR settings in different TMR1 modes:

Table 3-1. UTMR Settings for Different TMR1 Modes
TMR1 ModeUTMR SettingsComments
STARTRESETSTOPOther
GE - Gate EnableRising ERS EdgeNoneEither ERS Edge
GPOL - Gate PolarityRising ERS EdgeNoneEither ERS EdgeEPOL = Inverted
GTM - Gate Toggle ModeRising ERS EdgeNoneRising ERS EdgeThe CLC or NCO is used as a 1:2 frequency divider, which feeds into UTMR as ERS source.
GSPM - Gate Single Pulse ModeRising ERS EdgeNoneEither ERS EdgeOSEN = Enabled
GSPM + GTMRising ERS EdgeNoneRising ERS EdgeOSEN = Enabled