
16-bit Timers
11-31
11.6.7
Event Counting
When using timer 10 as an event counter, make the settings according to the procedure described below.
This event counter generates a compare/capture A interrupt when it has counted the specified number of edges.
(Refer to Fig. 11-6-15.)
The compare/capture B register can be used as a compare register or as a capture register.
Note: For details on the settings, refer to section 11.6.1, "Compare Register Settings."
■
Procedure for initiating operation
(1) Set the compare/capture A register mode.
Set the TM10MDA register as follows:
TM10AO2,1,0 Don't care
TM10ACE
0: Capture operation disabled
TM10AEG
Don't care
TM10AM1,0
00: Compare register (single-buffer)
or
01: Compare register (double-buffer)
If the interrupt cycle will change while the counting operation is in progress, be certain
to set "double-buffer."
(2) Set the input edge for the TM10IOB pin.
Select either the rising edge or the falling edge at the TM10BEG of the TM10MDB register.
(3) Set the timer division ratio.
Set the division ratio in TM10CA.
A compare/capture A interrupt request is then generated when the specified edge is counted (value set
in 1) times on the TM10IOB pin.
(4) Set the operating mode.
Set the TM10MD register as described below:
TM10CK2,1,0 111:
Sets the TM10IOB pin input as the clock source.
TM10CAE
1:
Clears TM10BC when TM10CA matches TM10BC.
TM10ONE
0:
Disables one-shot operation.
TM10TGE
0:
Disables timer start by an external trigger.
TM10PM1,0
Don't care; This setting is ignored.
TM10PME
0:
Selects the normal waveform.
TM10LDE
0:
Normal operation.
TM10CNE
0:
Stops counting operation.
(5) Initialize the timer.
Set TM10LDE in the TM10MD register to "1" in order to initialize timer 10.
TM10BC is cleared, and the pin output is reset.
In addition, if TM10CA is set as a double-buffer compare register, the value in the buffer is loaded into
the compare register.
After initialization is completed, be certain to reset TM10LDE back to "0" in order to restore normal
operation mode.
(6) Set the I/O port.
Set the I/O port to "input pin."
Note:For details on the I/O port register settings, refer to chapter 15, "I/O Ports."
(7) Enable the timer counting operation.
The counting operation starts when the TM10CNE in the TM10MD register is set to "1".
Summary of Contents for MN103001G/F01K
Page 1: ...MICROCOMPUTER MN1030 MN103001G F01K LSI User s Manual Pub No 23101 050E ...
Page 2: ......
Page 4: ......
Page 6: ......
Page 8: ......
Page 9: ...Table of Contents List of Figures and Tables 0 ...
Page 26: ...xviii ...
Page 27: ...1 0 1 General Specifications ...
Page 35: ...2 CPU 2 ...
Page 57: ...3 Extension Instruction Specifications 3 ...
Page 96: ...Extension Instruction Specifications 3 40 ...
Page 97: ...4 Memory Modes 3 4 ...
Page 102: ...Memory Modes 4 6 ...
Page 103: ...5 Operating Mode 5 ...
Page 107: ...6 Clock Generator 6 13 ...
Page 111: ...7 Internal Memory 7 ...
Page 114: ...Internal Memory 7 4 ...
Page 115: ...8 Bus Controller BC 8 ...
Page 189: ...9 Interrupt Controller 9 ...
Page 220: ...Interrupt Controller 9 32 ...
Page 221: ...10 8 bit Timers 9 10 ...
Page 254: ...8 bit Timers 10 34 ...
Page 255: ...11 16 bit Timers 11 ...
Page 292: ...16 bit Timers 11 38 ...
Page 293: ...12 Watchdog Timer 11 12 ...
Page 302: ...Watchdog Timer 12 10 ...
Page 303: ...13 Serial Interface 13 ...
Page 354: ...Serial Interface 13 52 ...
Page 355: ...14 A D Converter 14 ...
Page 367: ...15 I O Ports 15 ...
Page 431: ...16 Internal Flash Memory 16 ...
Page 439: ...17 17 Ordering Mask ROM ...
Page 442: ...Ordering Mask ROM 17 4 ...
Page 443: ...Appendix ...