Panasonic MN103001G/F01K User Manual
16-bit Timers
11-19
Fig. 11-6-1
Compare Register Operation (When Clock Source = IOCLK)
11.6.2
Capture Register Settings
In order to use either the timer 10 compare/capture A register or B register as a capture register, the following
settings must be made according to the procedure described below before timer 10 is initialized.
The explanation below refers only to the compare/capture A register, but similar settings would also need to be
The explanation below refers only to the compare/capture A register, but similar settings would also need to be
made for the compare/capture B register.
(1) Set the compare/capture A register mode.
Set the TM10MDA register as follows:
TM10AO2,1,0
Don't care
TM10ACE
1: Capture operation enabled
TM10AEG
Don't care (If "single-edge" is selected below, select either rising edge or falling edge
here.)
here.)
TM10AM1,0
10: Capture register (single-edge)
or
or
11: Capture register (dual-edge)
If "dual-edge" is selected, the setting in TM10AEG is ignored.
If "dual-edge" is selected, the setting in TM10AEG is ignored.
Once the timer 10 counting operation is enabled, the value in TM10BC is captured in TM10CA, and a compare/
capture A interrupt request is generated according to the timing shown in Fig. 11-6-2. (If the counting operation is
currently halted, the capture operation does not occur even if the selected edge is input to the pin.)
currently halted, the capture operation does not occur even if the selected edge is input to the pin.)
x'0000
x'0001
TM10CA value
TM10CA value-1
IOCLK
Compare/capture A
interrupt request
interrupt request
TM10CA value-2
x'0002
TM10CA value
TM10CA value-1
TM10BC value
(when TM10CAE = 0)
TM10CA value-2
TM10CA value+1 TM10CA value+2
TM10CA value+3
TM10BC value
(when TM10CAE = 1)