
XC161 Derivatives
Peripheral Units (Vol. 2 of 2)
Capture/Compare Units
User’s Manual
17-27
V2.2, 2004-01
CC12_X1, V2.1
17.7
Single Event Operation
If an application requires that one and only one compare event needs to take place
(within a certain time frame), single event operation helps to reduce software overhead
and to eliminate the need for fast reaction upon events.
In order to achieve a single event operation without this feature, software would have to
either disable the compare mode or write a new value, which is outside of the count
range of the timer, into the compare register, after the programmed compare match has
taken place. Thus, usually an interrupt service routine is required to perform this
operation. Interrupt response time may be critical if the timer period is very short - the
disable operation needs to be completed before the timer would reach the same value
again.
The single event operation eliminates the need for software to react after the first
compare match. The complete operation can be set up before the event, and no action
is required after the event. The hardware takes care of generating only one event, and
then disabling all further compare matches.
This option is programmed via the Single Event Mode register CCx_SEM and the Single
Event Enable register CCx_SEE. Each register provides one bit for each CCy register of
a unit.
CC1_SEM
Single Event Mode Ctrl. Reg.
SFR (FE28
H
/14
H
)
Reset Value: 0000
H
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
SEM
15
SEM
14
SEM
13
SEM
12
SEM
11
SEM
10
SEM
9
SEM
8
SEM
7
SEM
6
SEM
5
SEM
4
SEM
3
SEM
2
SEM
1
SEM
0
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
CC2_SEM
Single Event Mode Ctrl. Reg.
SFR (FE2C
H
/16
H
)
Reset Value: 0000
H
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
SEM
15
SEM
14
SEM
13
SEM
12
SEM
11
SEM
10
SEM
9
SEM
8
SEM
7
SEM
6
SEM
5
SEM
4
SEM
3
SEM
2
SEM
1
SEM
0
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
Field
Bits
Type
Description
SEMy
15 … 0
rw
Single Event Mode Control
0
Single Event Mode disabled for channel y
1
Single Event Mode enabled for channel y