ix
7.4.1
PWM 2 Control Register (CNTR2) ............................................................................................... 199
7.4.2
PWM 2 Compare Register (COMR2) ........................................................................................... 201
7.5
8-bit PWM Timer Interrupts ................................................................................................................ 203
7.6
Operation of Interval Timer Function ................................................................................................. 204
7.7
Operation of PWM Timer Function .................................................................................................... 206
7.8
States in Each Mode during 8-bit PWM Timer Operation .................................................................. 208
7.9
Notes on Using 8-bit PWM Timer ...................................................................................................... 210
7.10 Program Example for 8-bit PWM Timer ............................................................................................. 211
CHAPTER 8
8/16-BIT TIMER/COUNTER ...................................................................... 215
8.1
Overview of 8/16 -bit Timer/Counter .................................................................................................. 216
8.2
Block Diagram of 8/16-bit Timer/Counter .......................................................................................... 219
8.3
Structure of 8/16-bit Timer/Counter ................................................................................................... 221
8.3.1
Timer 1 Control Register (T1CR) .................................................................................................. 224
8.3.2
Timer 2 Control Register (T2CR) .................................................................................................. 227
8.3.3
Timer 1 Data Register (T1DR) ...................................................................................................... 229
8.3.4
Timer 2 Data Register (T1DR) ...................................................................................................... 231
8.4
8/16-bit Timer/Counter Interrupt ........................................................................................................ 233
8.5
Operation of Interval Timer Function ................................................................................................. 235
8.6
Operation of Counter Function .......................................................................................................... 237
8.7
Operation of the Square Wave Output Initial Setting Function .......................................................... 239
8.8
Operation of 8/16-bit Timer/Counter Stop and Restart ..................................................................... 241
8.9
States in Each Mode during 8/16-bit Timer/Counter Operation ......................................................... 242
8.10 Notes on Using 8/16-bit Timer/Counter ............................................................................................. 244
8.11 Program Examples for 8/16-bit Timer/Counter .................................................................................. 246
CHAPTER 9
EXTERNAL INTERRUPT CIRCUIT 1 (EDGE) .......................................... 251
9.1
Overview of External Interrupt Circuit 1 ............................................................................................. 252
9.2
Block Diagram of External Interrupt Circuit 1 .................................................................................... 253
9.3
Structure of External Interrupt Circuit 1 ............................................................................................. 255
9.3.1
External Interrupt 1 Control Register (EIE1) ................................................................................. 258
9.3.2
External Interrupt 1 Flag Register (EIF1) ...................................................................................... 260
9.4
External Interrupt Circuit 1 Interrupts ................................................................................................. 262
9.5
Operation of External Interrupt Circuit 1 ........................................................................................... 264
9.6
Program Example for External Interrupt Circuit 1 .............................................................................. 266
CHAPTER 10 EXTERNAL INTERRUPT CIRCUIT 2 (LEVEL) ........................................ 269
10.1 Overview of External Interrupt Circuit 2 ............................................................................................. 270
10.2 Block Diagram of External Interrupt Circuit 2 ..................................................................................... 271
10.3 Structure of External Interrupt Circuit 2 ............................................................................................. 272
10.3.1 External Interrupt 2 Control Register (EIE2) ................................................................................. 275
10.3.2 External Interrupt 2 Flag Register (EIF2) ...................................................................................... 277
10.4 External Interrupt Circuit 2 Interrupt ................................................................................................... 278
10.5 Operation of External Interrupt Circuit 2 ............................................................................................ 279
10.6 Program Example for External Interrupt Circuit 2 ............................................................................. 281
CHAPTER 11 A/D CONVERTER ..................................................................................... 283
11.1
Overview of A/D Converter ............................................................................................................... 284