UTMR Size and Buffered Access

UTMR is available in different sizes: 8, 16, 24, and 32-bit. The exact size configuration is specific to the device; refer to the device data sheet for more information. Regardless of the timer size, the TUxyTMR timer/counter register is not guarded for atomic access. However, the TUxyPR period register is double-buffered.

The raw TUxyTMR timer/counter register is not double-buffered and no read/write protection is offered in hardware. The user is encouraged to access or alter the timer value only using the capture and period registers described below. The raw counter may be directly accessed, but the access is not double-buffered and may corrupt the data if the operation is performed with a running timer.

To read the timer value, use CAPT command to capture the current counter value in TUxyCR capture register. To clear the raw timer register, use CLR command. Synchronization delay may apply while using CAPT and CLR commands based on CSYNC bit setting.

The TUxyPR period register is double-buffered and hardware protection is offered to alter the value of the register while the timer is running. To change the period of the timer, it is recommended to update the TUxyPR register, rather than to change the counter value. Refer to device data sheet on more details about updating period for a running timer.

Important: The size of UTMR is specific to the device. To increase the size of the UTMR, two timer instances can be chained using TUCHAIN register. Refer to device data sheet for specific details.