vii
38K0 Group User’s Manual
List of figures
CHAPTER 2 APPLICATION
Fig. 2.1.1 Memory map of registers related to I/O port ........................................................... 2-2
Fig. 2.1.2 Structure of Port Pi (i = 0 to 6) ................................................................................. 2-3
Fig. 2.1.3 Structure of Port Pi direction register (i = 0 to 6) .................................................. 2-3
Fig. 2.1.4 Structure of Port P0 pull-up control register ............................................................ 2-4
Fig. 2.1.5 Structure of Port P5 pull-up control register ............................................................ 2-4
Fig. 2.2.1 Memory map of registers related to interrupt .......................................................... 2-8
Fig. 2.2.2 Structure of Interrupt request register 1 ................................................................... 2-8
Fig. 2.2.3 Structure of Interrupt request register 2 ................................................................... 2-9
Fig. 2.2.4 Structure of Interrupt control register 1 .................................................................... 2-9
Fig. 2.2.5 Structure of Interrupt control register 2 .................................................................. 2-10
Fig. 2.2.6 Structure of Interrupt edge selection register ........................................................ 2-10
Fig. 2.2.7 Interrupt operation diagram ....................................................................................... 2-12
Fig. 2.2.8 Changes of stack pointer and program counter upon acceptance of interrupt request
..................................................................................................................................... 2-13
Fig. 2.2.9 Time up to execution of interrupt processing routine ........................................... 2-14
Fig. 2.2.10 Timing chart after acceptance of interrupt request ........................................... 2-14
Fig. 2.2.11 Interrupt control diagram ......................................................................................... 2-15
Fig. 2.2.12 Example of multiple interrupts ................................................................................ 2-17
Fig. 2.2.13 Connection example and port P0 block diagram when using key input interrupt .
................................................................................................................................... 2-19
Fig. 2.2.14 Registers setting related to key input interrupt (corresponding to Figure 2.2.13) .
................................................................................................................................... 2-20
Fig. 2.2.15 Sequence of changing relevant register ............................................................... 2-21
Fig. 2.2.16 Sequence of check of interrupt request bit .......................................................... 2-22
Fig. 2.3.1 Memory map of registers related to timers ............................................................ 2-23
Fig. 2.3.2 Structure of Prescaler 12, Prescaler X ................................................................... 2-23
Fig. 2.3.3 Structure of Timer 1 .................................................................................................. 2-24
Fig. 2.3.4 Structure of Timer 2, Timer X .................................................................................. 2-24
Fig. 2.3.5 Structure of Timer X mode register ......................................................................... 2-25
Fig. 2.3.6 Structure of Interrupt request register 1 ................................................................. 2-26
Fig. 2.3.7 Structure of Interrupt request register 2 ................................................................. 2-26
Fig. 2.3.8 Structure of Interrupt control register 1 .................................................................. 2-27
Fig. 2.3.9 Structure of Interrupt control register 2 .................................................................. 2-27
Fig. 2.3.10 Timers connection and setting of division ratios ................................................. 2-29
Fig. 2.3.11 Related registers setting ......................................................................................... 2-29
Fig. 2.3.12 Control procedure ..................................................................................................... 2-30
Fig. 2.3.13 Peripheral circuit example ....................................................................................... 2-31
Fig. 2.3.14 Timers connection and setting of division ratios ................................................. 2-31
Fig. 2.3.15 Related registers setting ......................................................................................... 2-32
Fig. 2.3.16 Control procedure ..................................................................................................... 2-32
Fig. 2.3.17 Judgment method of valid/invalid of input pulses ............................................... 2-33
Fig. 2.3.18 Related registers setting ......................................................................................... 2-34
Fig. 2.3.19 Control procedure ..................................................................................................... 2-35
Fig. 2.3.20 Timers connection and setting of division ratios ................................................. 2-36
Fig. 2.3.21 Related registers setting ......................................................................................... 2-37
Fig. 2.3.22 Control procedure ..................................................................................................... 2-38
Fig. 2.4.1 Memory map of registers related to Serial I/O ...................................................... 2-40
Fig. 2.4.2 Structure of Transmit/Receive buffer register ........................................................ 2-41
Fig. 2.4.3 Structure of Serial I/O status register ..................................................................... 2-41
Fig. 2.4.4 Structure of Serial I/O control register .................................................................... 2-42
Fig. 2.4.5 Structure of UART control register .......................................................................... 2-42