![ARTERY AT32F435 Series Reference Manual Download Page 292](http://html1.mh-extra.com/html/artery/at32f435-series/at32f435-series_reference-manual_2977592292.webp)
AT32F435/437
Series Reference Manual
2022.11.11
Page 292
Rev 2.03
14.3.4.6 TMR9 and TMR12 channel mode register1 (TMRx_CM1)
The channel can be used in input (capture mode) or output (compare mode). The direction of a channel
is defined by the corresponding CxC bits. All the other bits of this register have different functions in
input and output modes. The CxOx describes its function in output mode when the channel is in output
mode, while the CxIx describes its function in output mode when the channel is in input mode. Attention
must be given to the fact that the same bit can have different functions in input mode and output mode.
Output compare mode:
Bit
Register
Reset value
Type
Description
Bit 15
Reserved
0x0
resd
Kept at its default value.
Bit 14: 12
C2OCTRL
0x0
rw
Channel 2 output control
Bit 11
C2OBEN
0x0
rw
Channel 2 output buffer enable
Bit 10
C2OIEN
0x0
rw
Channel 2 output enable immediately
Bit 9: 8
C2C
0x0
rw
Channel 2 configuration
This field is used to define the direction of the channel 2
(input or output), and the selection of input pin when
C2EN=’0’:
00: Output
01: Input, C2IN is mapped on C2IFP2
10: Input, C2IN is mapped on C1IFP2
11: Input, C2IN is mapped on STCI. This mode works
only when the internal trigger input is selected by STIS
register.
Bit 7
Reserved
0x0
resd
Kept at its default value.
Bit 6: 4
C1OCTRL
0x0
rw
Channel 1 output control
This field defines the behavior of the original signal
C1ORAW.
000: Disconnected. C1ORAW is disconnected from
C1OUT;
001: C1ORAW is high when TMRx_CVAL=TMRx_C1DT
010: C1ORAW is low when TMRx_CVAL=TMRx_C1DT
011: Switch C1ORAW level when
TMRx_CVAL=TMRx_C1DT
100: C1ORAW is forced low
101: C1ORAW is forced high.
110: PWM mode A
–
OWCDIR=0,
C1ORAW
is
high
once
TMRx_C1DT>TMRx_CVAL, else low;
–
OWCDIR=1, C1ORAW is low once TMRx_ C1DT
<TMRx_CVAL, else high;
111: PWM mode B
–
OWCDIR=0, C1ORAW is low once TMRx_ C1DT
>TMRx_CVAL, else high;
–
OWCDIR=1, C1ORAW is high once TMRx_ C1DT
<TMRx_CVAL, else low.
Note: In the configurations other than
000’, the C1OUT is
connected to C1ORAW. The C1OUT output level is not
only subject to the changes of C1ORAW, but also the
output polarity set by CCTRL.
Bit 3
C1OBEN
0x0
rw
Channel 1 output buffer enable
0: Buffer function of TMRx_C1DT is disabled. The new
value written to the TMRx_C1DT takes effect
immediately.
1: Buffer function of TMRx_C1DT is enabled. The value
to be written to the TMRx_C1DT is stored in the buffer
register, and can be sent to the TMRx_C1DT register
only on an overflow event.
Bit 2
C1OIEN
0x0
rw
Channel 1 output enable immediately
In PWM mode A or B, this bit is used to accelerate the
channel 1 output’s response to the trigger event.
0: Need to compare the CVAL with C1DT before
generating an output