![Geehy SEMICONDUCTOR APM32F030x4x6x8xC Скачать руководство пользователя страница 123](http://html1.mh-extra.com/html/geehy-semiconductor/apm32f030x4x6x8xc/apm32f030x4x6x8xc_user-manual_573629123.webp)
www.geehy.com Page 122
and input mode. The OCxx in the register describes the function of the channel
in the output mode, and the ICxx in the register describes the function of the
channel in the input mode.
Output compare mode:
Field
Name
R/W
Description
1:0
CC1SEL
R/W
Capture/Compare Channel 1 Select
This bit defines the input/output direction and the selected input pin.
00: CC1 channel is output
01: CC1 channel is input, and IC1 is mapped on TI1
10: CC1 channel is input, and IC1 is mapped on TI2
11: CC1 channel is input, and IC1 is mapped on TRC, and only works in
internal trigger input
Note: This bit can be written only when the channel is disabled
(TMRx_CCEN register CC1EN=0).
2
OC1FEN R/W
Output Compare Channel1 Fast Enable
0: Disable
1: Enable
This bit is used to improve the response of the capture/compare output to
the trigger input event.
3
OC1PEN R/W
Output Compare Channel1 Preload Enable
0: Preloading function is disabled; write the value of TMRx_CC1 register
through the program and it will work immediately.
1: Preloading function is enabled; write the value of TMRx_CC1 register
through the program and it will work after an update event is generated.
Note: When the protection level is 3 and the channel is configured as output,
this bit cannot be modified.
When the preload register is uncertain, PWM
mode can be used only in single pulse mode (SPMEN=1); otherwise, the
following output compare result is uncertain.
6:4
OC1MOD R/W
Output Compare Channel1 Mode Configure
000: Freeze The output compare has no effect on OC1REF
001: The output value is high when matching. When the value of counter
CNT matches the value CCx of capture/compareregister, OC1REF will
be forced to be at high level
010: The output value is low when matching. When the value of the counter
matches the value of the capture/compareregister, OC1REF will be
forced to be at low level
011: Output flaps when matching. When the value of the counter matches
the value of the capture/compareregister, flap the level of OC1REF
100: The output is forced to be ow
Force OC1REF to be at low level
101: The output is forced to be high.
Force OC1REF to be at high level
110: PWM mode 1 (set to high when the counter value<output compare
value; otherwise, set to low)
111: PWM mode 2 (set to high when the counter value>output compare
value; otherwise, set to low)
Note: When the protection level is 3 and the channel is configured as output,
this bit cannot be modified.
In PWM modes 1 and 2, the OC1REF level
changes when the compare result changes or when the output compare
mode changes from freeze mode to PWM mode.
7
OC1CEN R/W
Output Compare Channel1 Clear Enable
0: OC1REF is unaffected by ETRF input.
1: When high level of ETRF input is detected, OC1REF=0
9:8
CC2SEL
R/W
Capture/Compare Channel2 Select
This bit defines the input/output direction and the selected input pin.
00: CC2 channel is output
01: CC2 channel is input, and IC2 is mapped on TI2