CMS32L051 User Manual |Chapter 5 Universal Timer Unit (Timer4)
www.mcu.com.cn 183 / 703
5.9 Multi-channel linkage operation of the universal timer unit
5.9.1 Operates as single-trigger pulse output function
Using 2 channels in pairs, a single-trigger pulse with any delay pulse width can be generated from
the input of the TImn pin. Delay and pulse width can be calculated using the following formula:
In single-count mode, the master channel runs and counts the latency. By detecting the start trigger,
the timer count register mn (TCRmn) of the master channel starts to run and loads the value of the timer
data register mn (TDRmn). The TCRmn register decrements the count from the value of the loaded
TDRmn register by counting the clock. If the TCRmn becomes 0000H, INTTMmn is output and the count
is stopped before the next start trigger is detected.
In single-count mode, the slave channel runs and the pulse width is counted. With the INTTMmn of
the master channel as the start trigger, the TCRmp register of the slave channel starts running and the
value of the TDRmp register is loaded. The TCRmp register decrements the count from the loaded
TDRmp register value by counting the clock. If the count value changes to 0000H, INTTMmp is output
and the count is stopped before the next start trigger (INTTMmn of the master channel) is detected. After
the INTTMmn is generated from the master channel and 1 count clock has passed, the output level of
TOmp becomes effective if the TCRmp becomes 0000H, it becomes an invalid level.
Software operation (TSmn=1) can be used as a start trigger to output a single trigger without using
the TImn pin input.
Notice: Because the TDRmn registers of the master channel and the TDRmp registers of the slave channels have different
loading timings, if you overwrite the TDRmn registers and TDRmp registers during the counting process, you may
compete with the load timing and output abnormal waveforms. The TDRmn registers must be overwritten after
INTTMmn is generated and TDRmp register after INTTMmp is generated.
Notem: Unit number (m= 0,1) n: master channel number (n=0, 2) p: slave channel number (n= 0:p=1, 2, 3, n=2: p=3)