BAT32G1x9 user manual | Chapter 6 Universal timer unit Timer4/8
209 / 1149
Rev.1.02
6.9 Multi-channel linkage operation function of the universal timer unit
6.9.1
Operation as a single-trigger pulse output function
Pairing the two channels enable a single-trigger pulse of any delay pulse width to be generated via the input of
the TImn pin. Delay and pulse width can be calculated using the following calculations:
In single count mode, the master channel runs and the delay is counted. By detecting start firing, the timer count
register mn (TCRmn) of the master channel starts running 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
TCRmn becomes "0000H", INTMmn is output and the count is stopped before the next start trigger is detected.
In single count mode, slave channels run and pulse widths are counted. With the INTMmn of the master channel
triggered as the start, the slave channel's TCRmp register starts running and loads the value of the TDRmp register.
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 (INTMmn of the
master channel) is detected. After generating INTMmn from the master channel and passing through a count clock,
the output level of TOmp becomes the effective level if TCRmp becomes "0000H" , which becomes invalid.
Software operation (TSmn=1) can also be used as a start trigger to output a single trigger pulse without using
the TImn pin input.
Remark: Because the mount timing of the TDRmn register of the master channel and the TDRmp register of the slave
channel is different, if the TDRmn register and the TDRmp register are rewritten during the counting process, it may
compete with the loading timing and output an abnormal waveform. The TDRmn register must be overwritten after
intTMmn is generated, and the TDRmp register must be overwritten after INTMmp is generated.
Note: m: Unit number (m=0,1)n: Master channel number (n=0,
2, 4, 6).
p: Slave channel number (m=0Time:n
<
p≤3
,
m=1Time:n
<
p≤7)
Delay = {TDRmn
(master) set
value
+
2
}
×
count
clock
period
Pulse width = {TDRmp
(dependent)
set
value
}
×
counting
clock
periods