The TUxyCLK
register bits select the clock source for the UTMR module. These bits allow the
selection of several possible synchronous and asynchronous clock sources. Because the
selected clock source also controls the optional synchronization of all external signals
for the UTMR module, delays between the selection of a function and its action may vary
according to the frequency of the selected clock source relative to the
microcontroller’s clock frequency. See the Synchronous vs.
Asynchronous Operation section for more details.
When an internal clock source is selected (clock derived from system oscillator), the
choice of clock source will affect the increment rate of the TUxyTMR register, relative
to the system instruction rate. When an external clock source is selected (a clock not
derived from the system oscillator), the UTMR module will work as either a timer or a
counter. When enabled to count and the
CPOL bit is set, the TUxyTMR counter register is incremented on the rising
edge of the selected external source. For increment on the falling edge of the selected
external clock source, the CPOL bit must be cleared. When operating from an external
clock source, the
CSYNC bit must also be set to synchronize the controls and ERS
signals to the clock domain of the selected external clock.
Important: Due to the
inherent uncertainty of reading or writing a
16-bit timer
with an 8-bit bus and operating from an asynchronous clock source, it is recommended
that read/write of the timer registers use the
CAPT and the
CLR commands. Refer to the
Timer Counter and
Capture Registers section for more information.