Table of Contents
Freescale Semiconductor, Inc.
12.5 Using the Output Compare Function to Generate a Square Wave . . . 166
12.5.1 Sample Calculation to Obtain Period Counts . . . . . . . . . . . . . . . . . 166
12.5.2 Equipment. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
12.5.3 Code Listing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Section 13. Enhanced Capture Timer (ECT) Module
13.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
13.2 Basic Timer Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
13.3 Enhanced Capture Timer Modes of Operation . . . . . . . . . . . . . . . . . . . 169
13.3.1 IC Channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
13.3.1.1 Non-Buffered IC Channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
13.3.1.2 Buffered IC Channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
13.3.2 Pulse Accumulators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
13.3.2.1 Pulse Accumulator Latch Mode . . . . . . . . . . . . . . . . . . . . . . . . . 171
13.3.2.2 Pulse Accumulator Queue Mode . . . . . . . . . . . . . . . . . . . . . . . . 171
13.3.3 Modulus Down-Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
13.4 Timer Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
13.4.1 Timer Input Capture/Output Compare Select Register. . . . . . . . . . 176
13.4.2 Timer Compare Force Register . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
13.4.3 Output Compare 7 Mask Register . . . . . . . . . . . . . . . . . . . . . . . . . 177
13.4.4 Output Compare 7 Data Register . . . . . . . . . . . . . . . . . . . . . . . . . . 178
13.4.5 Timer Count Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
13.4.6 Timer System Control Register. . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
13.4.7 Timer Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
13.4.8 Timer Interrupt Mask Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
13.4.9 Main Timer Interrupt Flag Registers . . . . . . . . . . . . . . . . . . . . . . . . 183
13.4.10 Timer Input Capture/Output Compare Registers . . . . . . . . . . . . . . 185
13.4.11 16-Bit Pulse Accumulator A Control Register . . . . . . . . . . . . . . . . . 188
13.4.12 Pulse Accumulator A Flag Register . . . . . . . . . . . . . . . . . . . . . . . . 189
13.4.13 Pulse Accumulators Count Registers . . . . . . . . . . . . . . . . . . . . . . . 190
13.4.14 16-Bit Modulus Down-Counter Control Register. . . . . . . . . . . . . . . 191
13.4.15 16-Bit Modulus Down-Counter Flag Register . . . . . . . . . . . . . . . . . 192
13.4.16 Input Control Pulse Accumulators Control Register . . . . . . . . . . . . 193
13.4.17 Delay Counter Control Register . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
13.4.18 Input Control Overwrite Register . . . . . . . . . . . . . . . . . . . . . . . . . . 194
13.4.19 Input Control System Control Register . . . . . . . . . . . . . . . . . . . . . . 194
13.4.20 Timer Test Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
13.4.21 Timer Port Data Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
13.4.22 Data Direction Register for Timer Port . . . . . . . . . . . . . . . . . . . . . . 197
13.4.23 16-Bit Pulse Accumulator B Control Register . . . . . . . . . . . . . . . . . 197
13.4.24 Pulse Accumulator B Flag Register . . . . . . . . . . . . . . . . . . . . . . . . 198
13.4.25 8-Bit Pulse Accumulators Holding Registers . . . . . . . . . . . . . . . . . 198
13.4.26 Modulus Down-Counter Count Registers . . . . . . . . . . . . . . . . . . . . 199
13.4.27 Timer Input Capture Holding Registers . . . . . . . . . . . . . . . . . . . . . 200
13.5 Timer and Modulus Counter Operation in Different Modes . . . . . . . . . 202
Data Sheet
12
Table of Contents
For More Information On This Product,
Go to: www.freescale.com
M68HC12B Family — Rev. 9.0
MOTOROLA