Hardware Reference
In-Depth Information
Parallel I/O interface
Serial I/O interface such as UART, SPI, I 2 C, and CAN
Memory component interface circuitry
The HCS12 from Freescale incorporates most of these peripheral modules and the CPU in one
VLSI chip.
Memory is where software programs and data are stored. Semiconductor memory chips can
be classified into two major categories: random-access memory and read-only memory. RAM
technology includes DRAM, FRAM, MRAM, and SRAM. MROM, PROM, EPROM, EEPROM,
and flash memory are read-only memories.
Programs are known as software. A program is a set of instructions that the computer
hardware can execute. In the past, system designers mainly used assembly language to write
microcontroller application software. The nature of assembly language forces an assembly pro-
grammer to work on the program logic at a relatively low level. This hampers programming
productivity. In the last 15 years, more and more people have turned to high-level language to
improve their programming productivity. C is the most widely used language for embedded
system programming.
Although system designers use assembly or high-level language to write their programs,
the microcontroller can only execute machine instructions. Programs written in assembly or
high-level language must be translated into machine instructions before they can be executed.
The program that performs the translation work is called an assembler or compiler depending
on the language to be translated.
A machine instruction consists of opcode and addressing information that specifies the
operands. Addressing information is also called addressing mode . The HCS12 implements a
rich instruction set along with many addressing modes for specifying operands. This chapter
examines the functions of a few groups of instructions. Examples were used to explore the
implementation of simple operations using these instructions.
The execution of an instruction may take several clock cycles. Because the HCS12 does not
access memory in every clock cycle, it performs instruction prefetch to speed up the instruc-
tion execution. A two-word (16-bit word) instruction prefetch queue and a 16-bit buffer are
added to hold the prefetched instructions.
1.14 Exercises
E1.1 What is a processor?
E1.2 What is a microprocessor? What is a microcomputer?
E1.3 What makes a microcontroller different from a microprocessor?
E1.4 How many bits can the HCS12 CPU manipulate in one operation?
E1.5 How many different memory locations can the HCS12 access without the expanded
memory?
E1.6 Why must every computer have some amount of nonvolatile memory?
E1.7 Why must every computer have some amount of volatile memory?
E1.8 What is source code? What is object code?
E1.9 Convert 5K, 8K, and 13K to decimal representation.
E1.10 Write an instruction sequence to swap the contents of memory locations at $1000 and
$1001.
E1.11 Write an instruction sequence to add 10 to memory locations at $1000 and $1001,
respectively.
 
Search WWH ::




Custom Search