Page 304 - Programming Microcontrollers in C
P. 304
The MC68HC16 289
aid in writing programs for the component in C. There are several
Motorola manuals that are useful adjuncts to this chapter. 1 2 3 4 5 6
Copies of these manuals are all to be found on the attached CD
ROM. It is recommended that these manuals be reviewed prior to
any attempt to write code for this family.
CPU16 Core Processor
The CPU16 represents an attempt to bridge the difference be
tween the large 8-bit microcontrollers and the high-end components
embodied in the MC68300 family. This processor is a 16-bit proces
sor. As such, its instructions are each 16 bits wide, instructions are
read from memory 16 bits at time, and the instructions are processed
16 bits at a time. On this particular part, a 20-bit address bus with
additional control allows the program to access two individual one-
megabyte address maps. The controls available distinguish between
program memory and data memory.
It has been stated several times that the programmer’s model for
a microcontroller is not too important when writing code in C. To be
able to access all of the features of a CPU16, you will have to use
assembly language-based functions. There are certain features that
are simply outside the concept of a high-level language. In these
cases, it is recommended that functions which access and control
these features be written and then you can call these functions from
the C program. The main properties of the CPU16 that are not avail
able to the C programmer are the DSP type registers found in the
part. Programming of these registers is the subject of a later section
of this chapter.
The 20-bit address space of the CPU16 is a significant deviation
from the normal 16-bit address space of the MC68HC11. This change
has been handled by the addition of several 4-bit extension registers
for those registers that deal specifically with addresses. These regis
ters are the program counter (PC), the stack pointer (SP), the three
1 M68HC16 Family MC68HC16Z1 Users Manual MC68HC16Z1UM/AD
2 M68HC16 Family CPU16 Central Processor Unit Reference Manual CPU16RM/AD
3 Modular Microcontroller Family GPT General Purpose Timer Reference Manual GPTRM/AD
4 Modular Microcontroller Family ADC Analog-to-Digital Converter Reference Manual ADCRM/AD
5 Modular Microcontroller Family QSM Queued Serial Module Reference Manual QSMRM/AD
6 Modular Microcontroller Family SIM System Integration Module Reference Manual SIMRM/AD