
vii
7.9
Notes on Using 8-bit PWM Timers .................................................................................................... 157
7.10 Program Example for PWM Timers ................................................................................................... 159
CHAPTER 8
8/16-BIT CAPTURE TIMERS/COUNTERS ............................................... 163
8.1
Overview of 8/16-bit Capture Timer/Counter ..................................................................................... 164
8.2
Configuration of 8/16-bit Capture Timer/Counter ............................................................................... 168
8.3
Pin of 8/16-bit Capture Timer/Counter ............................................................................................... 171
8.4
Registers of 8/16-bit Capture Timer/Counter ..................................................................................... 173
8.4.1
Capture Control Register (TCCR) ................................................................................................ 174
8.4.2
Timer 0 Control Register (TCR0) .................................................................................................. 176
8.4.3
Timer 1 Control Register (TCR1) .................................................................................................. 178
8.4.4
Timer Output Control Register (TCR2) ......................................................................................... 180
8.4.5
Timer 0 Data Register (TDR0) ...................................................................................................... 181
8.4.6
Timer 1 Data Register (TDR1) ...................................................................................................... 183
8.4.7
Capture Data Registers H and L (TCPH and TCPL) .................................................................... 185
8.5
8/16-bit Capture Timer/Counter Interrupts ......................................................................................... 186
8.6
Explanation of Operations of Interval Timer Functions ...................................................................... 188
8.7
Explanation of Operations of Counter Functions ............................................................................... 192
8.8
Explanation of Operations of Capture Functions ............................................................................... 196
8.9
8/16-bit Capture Timer/Counter Operation in Each Mode ................................................................. 200
8.10 Notes on Using 8/16-bit Capture Timer/Counter ............................................................................... 201
8.11 Program Example for 8/16-bit Capture Timer/Counter ..................................................................... 203
CHAPTER 9
12-BIT PPG TIMERS ................................................................................. 207
9.1
Overview of 12-bit PPG Timer ........................................................................................................... 208
9.2
Configuration of 12-bit PPG Timer Circuit ......................................................................................... 211
9.3
Pin of 12-bit PPG Timer ..................................................................................................................... 213
9.4
Registers of 12-bit PPG Timer ........................................................................................................... 215
9.4.1
12-bit PPG Control Register 1 (RCR21) ....................................................................................... 216
9.4.2
12-bit PPG Control Register 2 (RCR22) ....................................................................................... 217
9.4.3
12-bit PPG Control Register 3 (RCR23) ....................................................................................... 218
9.4.4
12-bit PPG Control Register 4 (RCR24) ....................................................................................... 220
9.5
Explanation of Operations of 12-bit PPG Timer Functions ................................................................ 221
9.6
Notes on Using 12-bit PPG Timer ..................................................................................................... 223
9.7
Program Example for 12-bit PPG Timer ........................................................................................... 225
CHAPTER 10 EXTERNAL INTERRUPT CIRCUIT 1 (EDGE) .......................................... 227
10.1 Overview of External Interrupt Circuit 1 ............................................................................................. 228
10.2 Configuration of External Interrupt Circuit 1 ....................................................................................... 229
10.3 Pin of External Interrupt Circuit 1 ....................................................................................................... 231
10.4 Registers of External Interrupt Circuit 1 ............................................................................................. 233
10.4.1 External Interrupt Control Register 1 (EIC1) ................................................................................. 234
10.4.2 External Interrupt Control Register 2 (EIC2) ................................................................................. 237
10.5 Interrupt of External Interrupt Circuit 1 ............................................................................................... 239
10.6 Explanation of Operations of External Interrupt Circuit 1 ................................................................... 241
10.7 Program Example for External Interrupt Circuit 1 .............................................................................. 243