AT32F425
Series Reference Manual
2022.03.30
Page 260
Ver 2.01
14.6.3.4 TMR output function
The TMR output consists of a comparator and an output controller. It is used to program the period, duty
cycle and polarity of the output signal. The advanced-control timer output function varies from one
channel to one channel.
Figure 14-90
Channel output stage (channel 1 to 3)
Output
mode
controller
CxORAW
Output
enable
circuit
C1OUT
EXT
CVAL>CxDT
CVAL = CxDT
To the master
mode controller
CVAL
CxDT
Compare
Polarity
selection
Dead time
generate
Output
Compare
Mode
C1COUT
Figure 14-91
Channel 4 output stage
Output
mode
controller
C4ORAW
Output
enable
circuit
C4OUT
EXT
CVAL>C4DT
CVAL = C4DT
To the master
mode controller
CVAL
C4DT
Compare
Polarity
selection
Output mode
Write CxC[2: 0]≠2’b00 to configure the channel as output to implement multiple output modes. In this
case, the counter value is compared with the value in the TMRx_CxDT register, and the intermediate
signal CxORAW is generated according to the output mode selected by CxOCTRL[2: 0], which is sent
to IO after being processed by the output control circuit. The period of the output signal is configured by
the TMRx_PR register, while the duty cycle by the TMRx_CxDT register.
Output compare modes include:
PWM mode:
Set CxOCTRL=2’b110/111 to enable PWM mode. Each channel can be
independently configured to output one PWM signal. In this case, the period of the output signal
is configured by the TMRx_PR register, and the duty cycle by the CxDT register. The counter
value is compared with the value of the TMRx_CxDT register, and the corresponding level signal
is sent according to the counting direction. For more information on PWM mode A/B, refer to the
description of the CxOCTRL[2: 0] bit. In up/down counting mode, the OWCDIR bit is used to
indicate the counting direction.
Forced output mode:
Set CxOCTRL=2’b100/101 to enable forced output mode. In this case,
the CxORAW is forced to be the programmed level, irrespective of the counter value. Despite
this, the channel flag bit and DMA request still depend on the compare result.
Output compare mode:
Set CxOCTRL=2’b001/010/011 to enable output compare mode. In this
case, when the counter value matches the value of the CxDT register, the CxORAW is forced
high, low or toggling.
One-pulse mode:
This is a particular case of PWM mode. Set OCMEN=1 to enable one-pulse
mode. In this mode, the comparison match is performed in the current counting period. The
TMREN bit is cleared as soon as the current counting is completed. Therefore, only one pulse is
output. When configured as in upcounting mode, the configureation must follow the rule:
CVAL<CxDT≤PR; in downcounting mode, CVAL>CxDT is required.
Fast output mode:
Set CxOIEN=1 to enable this mode. If enabled, the CxORAW signal will not
change when the counter value matches the CxDT, but at the beginning of the current counting
period. In other words, the comparison result is advanced, so the comparison result between the
counter value and the TMRx_CxDT register will determine the level of CxORAW in advance.
gives an example of output compare mode (toggle) with C1DT=0x3. When the counter
value is equal to 0x3, C1OUT toggles.