Page 303 - Programming Microcontrollers in C
P. 303

288    Chapter 6  Large Microcontrollers

                          status of the machine before the normal interrupt operations can pro­
                          ceed. We will see a few other differences between these devices, but
                          the main difference is in the way peripherals are handled.
                              On the MC68HC16, the core processor is called the CPU16. This
                          central computer is interfaced to an internal bus called the
                          inter-modual bus (IMB). The IMB is very much like the bus a hard­
                          ware designer would put onto an external circuit board. It has address
                          and data busses and all of the necessary control signals to control any
                          peripheral that the microcontroller might have applied. In the stan­
                          dard device, the MC68HC16Z1, there are five built-in peripherals:
                          the system integration module (SIM), the analog-to-digital converter
                          (ADC), the queued serial peripheral interface module (QSPI), the
                          general-purpose timer module (GPT), and the static random access
                          memory module (SRAM). These modules and others can be added or
                          deleted in future components as the customer needs dictate.
                              The several internal peripheral modules are each interfaced to the
                          IMB. Each module has a specific set of registers that are located at an
                          address relative to the base address of the module. These base ad­
                          dresses are set at design time. This is interesting because the same
                          modules are used on the MC68300 series of microcontrollers, which
                          are 32-bit microcontrollers. Therefore, the material presented in this
                          chapter is directly applicable to the MC68300 series of microcontrollers.
                          The only difference that the programmer will see is that the base
                          memory locations of the various peripheral modules are different, but
                          even these differences disappear because of the careful design of the
                          microcontrollers. We therefore can consider this chapter to be on large
                          microcontrollers rather than on the 16-bit systems alone.

            The MC68HC16

                              The MC68HC16 is a truly complicated device. However, for our
                          purposes, it can be divided into its several components, and each
                          component is somewhat as one would expect from a programming
                          standpoint. Therefore, we will examine this family of parts as a col­
                          lection of modules. Each module is rather straightforward. The core
                          processor, which is known as the CPU16, is indeed a complete and
                          competent microcomputer. The bulk of its complexity is hidden by
                          the fact that the program is written in C. This section contains a brief
                          description of the MC68HC16Z1 microcontroller that can be used to
   298   299   300   301   302   303   304   305   306   307   308