Page 306 - Programming Microcontrollers in C
P. 306

The MC68HC16       291

                          pointer. Finally the address 6 must contain the initial value of the IZ
                          register. Note that the word addresses in the MC68HC16 are always
                          even. In this machine you will find words on even boundaries, bytes
                          anywhere, and long words on even boundaries. These data are loaded
                          into this memory area by the use of a vector routine similar to that seen
                          in Chapter 5 for the MC68HC11. With this approach, all of the regis­
                          ters needed to begin operation of the basic computer are loaded from
                          memory at reset time. Of course, this operation does not eliminate the
                          need for program initialization; it merely provides a mechanism by
                          which the processor will start accessing memory at the correct ad­
                          dresses when the device comes out of reset.
                              Table 6-1 contains a listing of the uses of each entry in the
                          vector table. Note that vectors 0x0 through 0x37 have assigned
                          functions. The vectors 0x38 through 0xff are available for user-
                          defined operations. Note the relationship between the vector number
                          and the vector address. The vector address is always twice the vec-
                              Table 6-1: Exception Vector Table

                                 Vector
                                              Vector Address        Type of Exception
                                Number
                                   0             0x0000           Reset—Initial ZK, SK, PK
                                   1             0x0002               Reset—Initial PC
                                   2             0X0004              Reset—Initial SP
                                   3             0X0006               Reset—Initial IZ
                                   4             0X0008                 Breakpoint
                                   5             0X000A                 Bus Error
                                   6             0X000C              Software Interrupt
                                   7             0X000E              Illegal Instruction
                                   8             0X0010              Division by Zero
                                  9-E        0X0012-0X001C         Unassigned, Reserved
                                   F             0X001E            Uninitialized Interrupt
                                   10            0X0020              Level 0 Autovector
                                   11            0X0022              Level 1 Autovector
                                   12            0X0024              Level 2 Autovector
                                   13            0X0026              Level 3 Autovector
                                   14            0X0028              Level 4 Autovector
                                   15            0X002A              Level 5 Autovector
                                   16            0X002C              Level 6 Autovector
                                   17            0X002E              Level 7 Autovector
                                   18            0X0030              Spurious Interrupt
                                 19-37       0X0032-0X006E         Unassigned, Reserved
                                 38-FF       0X0070-0X01FE         User-defined Interrupts
   301   302   303   304   305   306   307   308   309   310   311