www.geehy.com Page 170
Field
Name
R/W
Description
1
CC1IFLG
RC_W0
Capture/Compare Channel1 Interrupt Flag
When the capture/compare channel 1 is configured as output:
0: No matching occurred
1: The value of TMRx_CNT matches the value of TMRx_CC1
When the capture/compare channel 1 is configured as input:
0: Input capture did not occur
1: Input capture occurred
When a capture event occurs, the bit is set to 1 by hardware, and it
can be cleared by software or cleared when reading TMRx_CC1
register.
8:7
Reserved
9
CC1RCFLG
RC_W0
Capture/compare Channel1 Repetition Capture Flag
0: Repeat capture does not occur
1: Repeat capture occurs
The value of the counter is captured to TMRx_CC1 register, and
CC1IFLG=1; this bit is set to 1 by hardware and cleared by
software only when the channel is configured as input capture.
15:10
Reserved
Control event generation register (TMRx_CEG)
Offset address: 0x14
Reset value: 0x0000
Field
Name
R/W
Description
0
UEG
W
Update Event Generate
0: Invalid
1: Initialize the counter and generate the update event
This bit is set to 1 by software, and cleared by hardware.
Note: When an update event is generated, the counter of the prescaler will be
cleared, but the prescaler factor remains unchanged.
In the count-down mode,
the counter reads the value of TMRx_AUTORLD; in center-aligned mode or
count-up mode, the counter will be cleared.
1
CC1EG
W
Capture/Compare Channel1 Event Generation
0: Invalid
1: Capture/Compare event is generated
This bit is set to 1 by software and cleared automatically by hardware.
If Channel 1 is in output mode:
When CC1IFLG=1, if CC1IEN and CC1DEN bits are set, the corresponding
interrupt and DMA request will be generated.
If Channel 1 is in input mode:
The value of the capture counter is stored in TMRx_CC1 register; configure
CC1IFLG=1, and if CC1IEN and CC1DEN bits are also set, the corresponding
interrupt and DMA request will be generated; at this time, if CC1IFLG=1, it is
required to configure CC1RCFLG=1.
15:2
Reserved
Capture/Compare mode register 1 (TMRx_CCM1)
Offset address: 0x18
Reset value: 0x0000
The timer can be configured as input (capture mode) or output (compare mode)
by CCxSEL bit. The functions of other bits of the register are different in input
and output modes, and the functions of the same bit are different in output mode
and input mode. The OCx 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.