Motorola reserves the right to make changes without further notice to any products
herein. Motorola makes no warranty, representation or guarantee regarding the
suitability of its products for any particular purpose, nor do es Motorola assume any
liability arisin g out of the app lication or u se of any pr oduct or ci rcuit, a nd sp ecifica lly
disclaims any and all liability, including without limitation consequ ential or incidental
damages. "Typical" parameters which may be provided in Motorola data sheets and/or
specifications can and do vary in different applications and actual performance may
vary over time. All operating parameters, including "Typicals" must be validated for
each customer application by customer’s technical experts. Motorola does not convey
any license under its patent rights nor the rights of others. Motorola products are not
designed, intended, or authorized for use as components in systems intended for
surgical implant into the body, or other applications intended to support or sustain life,
or for any other application in which the failure of the Motorola product could create a
situation where personal injury or death may occur. Should Buyer purchase or use
Motorola products for any such unintended or unauthorized application, Buyer shall
indemnify and hold Motorola and its officers, employees, subsidiaries, af filiates, and
distributors harmless against all claims, costs, damages, and expenses, and
reasonable attorney fees a rising out of, directly or indirectly, any claim of personal
injury or death associated with such unintended or unauthorized use, even if such claim
alleges that Motorola was negligent regarding t he design or manufacture of the part.
Motorola, Inc. is an Equal Opportunity/Affirmative Action Employer.
The CPU08 is the central processor unit (CPU) of the Motorola
M68HC08 Family of microcontroller units (MCU). The fully object code
compatible CPU08 offers M68HC05 users increased performance with
no loss of time or software investment in their M68HC05-based
applications. The CPU08 also appeals to users of other MCU
architectures who need the CPU08 combination of speed, low power,
processing capabilities, and cost effectiveness.
CPU08 — Rev. 3.0Reference Manual
MOTOROLAGeneral Description 19
General Description
1.3 Features
CPU08 features include:
•Full object-code compatibility with M68HC05 Family
•16-bit stack pointer with stack manipulation instructions
•16-bit index register (H:X) with high-byte and low-byte
manipulation instructions
•8-MHz CPU standard bus frequency
•64-Kbyte program/data memory space
•16 addressing modes
•78 new opcodes
•Memo ry-to-memory data moves without using accumulator
•Fast 8-bit by 8-bit multiply and 16-bit by 8-bit divide instructions
•Enhanced binary-coded decimal (BCD) data handling
•Expandable internal bus definition for extension of addressing
•Flexible internal bus definition to accommodate CPU
•Low-power stop and wait modes
1.4 Programming Model
The CPU08 programming model consists of:
•8-bit accumulator
•16-bit index register
•16-bit stack pointer
•16-bit program counter
range beyond 64 Kbytes
performance-enhancing peripherals such as a direct memory
access (DMA) controller
•8-bit condition code register
See Figure 2-1. CPU08 Programming Model .
Reference ManualCPU08 — Rev. 3.0
20General Descri ptio nMOTOR OLA
1.5 Me mory Space
Program memory space and data memory space are cont iguous over a
64-Kbyte addressing range. Addition of a page-switching peripheral
allows extension of the addressing range beyond 64 Kbytes.
1.6 Addressing Modes
The CPU08 has a total of 16 addressing modes:
•Inherent
•Immediate
•Direct
•Extended
General Description
Memory Space
•Indexed
–No offset
–No offset, post increment
–8-bit offset
–8-bit offset, post increment
–16-bit offset
•Stack pointer
–8-bit offset
–16-bit offset
•Relative
•Memory-to-memory (four modes)
Refer to Sectio n 4 . Addres sing Mo des for a detail ed descriptio n of the
CPU08 addressing modes.
CPU08 — Rev. 3.0Ref erence Manual
MOTOROLAGeneral Description 21
General Description
1.7 Arithmetic Instructions
The CPU08 arithmetic functions include:
•Addition with and without carry
•Subtraction with and without carry
•A fast 16-bit by 8-bit unsigned division
•A fast 8-bit by 8-bit unsigned multiply
1.8 Binary-Coded Decimal (BCD) Arithmetic Support
To support binary-coded decimal (BCD) arithmetic applications, the
CPU08 has a de cimal adjust accumulator (DAA) instruction a nd a nibble
swap accumulator (NSA) instruction.
1.9 High-Level Language Support
The 16-bit index register, 16-bit stack pointer, 8-bit signed branch
instructions, and associated instructions are designed to support the
efficient use of high-level language (HLL) compilers with the CPU08.
1.10 Low-Power Modes
The WAIT and S TOP instr uctions red uce th e po w er consum ption of th e
CPU08-based MCU. The WAIT instruction stops only the CPU clock and
therefore us es more pow er than the STOP instru ction, which stops both
the CPU clock and the peripheral clocks. In most modules, clocks can
be shut off in wait mode.
Figure 2-1 shows the five CPU08 registers. The CPU08 registers are
not part of the memory map.
70
AACCUMULATOR (A)
15870
HXINDEX REGISTER (H:X)
150
STACK POINTER (SP)
150
PROGRAM COUNTER (PC)
70
V11H I NZC
TWO’S COMPLEMENT OVERFLOW
FLAG (V)
ZERO FLAG (Z)
HALF-CARRY FLAG (H)
NEGATIVE FLAG (N)
INTERRU PT MASK (I )
CONDITION CODE
REGISTER (CCR)
CARRY/BORROW FLAG (C)
Figure 2-1. CPU08 Programming Model
Reference ManualCPU08 — Rev. 3.0
24ArchitectureMOTOROLA
2.3.1 Accumulator
2.3.2 Index Register
Architecture
CPU08 Registers
The accumulator (A) shown in Figure 2-2 is a general-purpose 8-bit
register. The central processo r unit (CPU ) uses the accumulator to hol d
operands and results of arithmetic and non-arithmetic operations.
Bit 7654321Bit 0
Read:
Write:
Reset:XXXXXXXX
X = Indeterminate
Figure 2-2. Accumulator (A)
The 16-bit index register (H:X) shown in Figure 2-3 allows the user to
index or address a 64-Kbyte memory space. The concatenated 16-bit
register is called H:X. The upper byte of the index register is called H.
The lower byte of the index register is called X. H is cleared by reset.
When H = 0 and no instructions that affect H are used, H:X is functionally
identical to the IX register of the M6805 Family.
In the indexed addressing mod es, the CPU uses the conten ts of H:X to
determine th e effective ad dress of th e operand . H:X can also serv e as a
temporary data storage location. See 4.3.5 Indexed, No Offset;
4.3.6 Indexed, 8-Bit Offs et; and 4.3.7 Indexed, 16-Bit Offset.
Bit 151413121110987654321Bit 0
Read:
Write:
Reset:X XXXXXXXXXXXXXXX
X = Indeterminate
Figure 2-3. Index Register (H:X)
CPU08 — Rev. 3.0Ref erence Manual
MOTOROLAArchitecture 25
Architecture
2.3.3 Stack Pointer
NOTE:The reset stack pointer (RSP) instruction sets the least significant byte
The stack pointer (SP) shown in Figure 2-4 is a 16-bit register that
contains the addr ess of the next location on the stack. During a reset, the
stack pointer is preset to $00FF to provide compatibility with the M6805
Family.
to $FF and does not affect the most significant byte.
The address in the stack pointer decremen ts as data is pushe d onto the
stack and increments as data is pulled from the stack. The SP always
points to the next available (empty) byte on the stack.
The CPU08 ha s stack poin ter 8- and 16-bit offse t addressing m odes that
allow the stack pointer to be used as an index register to access
temporary variab les on the stack. The CPU uses the contents in the SP
register to determine the effective address of the operand. See
NOTE:Although pres et to $00FF, the loca tion of the sta ck is arbi trary and may
be relocated by the user to anywhere that random-access memory
(RAM) resides within the memory map. Moving the SP out of page 0
($0000 to $00FF) will free up address space, which may be accessed
using the efficient direct addressing mode.
Reference ManualCPU08 — Rev. 3.0
26ArchitectureMOTOROLA
2.3.4 Program Counter
The program counter (PC) shown in Figure 2-5 is a 16-bit register that
contains the address of the next instruction or operand to be fetched.
Normally, the address in the pr ogra m counte r auto matical ly incre ments
to the next sequential memory location every time an instruction or
operand is fetched. Jump, branch, and interrupt operations load the
program counter with an address other than that of the next sequential
location.
During reset, the PC is loaded with the contents of the reset vector
located at $FFFE and $FFFF. This represents the address of the first
instruction to be executed after the reset state is exited.
Architecture
CPU08 Registers
Bit 151413121110987654321Bit 0
Read:
Write:
Reset:Loaded with vector from $FFFE and $FFFF
Figure 2-5. Program Counter (PC)
CPU08 — Rev. 3.0Ref erence Manual
MOTOROLAArchitecture 27
Architecture
2.3.5 Condition Code Register
The 8-bit condition code register (CCR) shown in Figure 2-6 contains
the interrupt mask and five flags that indicate the result s of the instruction
just executed. Bits five and six are permanently set to logic 1.
Read:
Write:
Reset:X11X1XXX
X = Indeterminate
V — Overflow Flag
Bit 7654321Bit 0
V11H I NZC
Figure 2-6. Condition Code Register (CCR)
The CPU sets the overflow flag when a two's complement overflow
occurs as a result of an operation. The overflow flag bit is utilized by
the signed branch instructions:
Branch if greater than, BGT
Branch if greater than or equal to, BGE
Branch if less than or equal to, BLE
Branch if less than, BLT
This bit is set by th ese instr uctions, although its r esulting value h olds
no meaning:
Arithmetic shift left, ASL
Arithmetic shift right, ASR
Logical shift left, LSL
Logical shift right, LSR
Rotate left through carry, ROL
Rotate right through carry, ROR
H — Half-Carry Flag
The CPU sets the half-carry fla g when a carr y occurs betwee n bits 3
and 4 of the accumulator during an add-without-carry (ADD) or
add-with-carry (ADC) operation. The half-carry flag is required for
Reference ManualCPU08 — Rev. 3.0
28ArchitectureMOTOROLA
CPU08 Registers
binary-coded (BCD) arithmetic operations. The decimal adjust
accumulator (DAA) instruction uses the state of the H and C flags to
determine the appropriate correction factor.
I — Interrupt Mask
When the interrupt mask is set, all interrupts are disabled. Interrupts
are enabled when the interrupt mask is cleared. When an interrupt
occurs, the interr upt mask is automatica lly set after the CPU reg isters
are saved on the stack, but before the interrupt vector is fetched.
NOTE:To maintain M6805 compatibility, the H register is not stacked
automatically . If the interrupt service routine uses X (and H is not clea r),
then the user must stack and unstack H using the push H (index register
high) onto stack (PSHH) and pull H (index register high) from stack
(PULH) instructions within the interrupt service routine.
Architecture
If an interrupt occurs while the interrupt mask is set, the interrupt is
latched. Interrupts in or der of priority are ser viced as soon as the I bit
is cleared.
A return-from-interrupt (RTI) instruction pulls the CPU registers from
the stack, restoring the interrupt mask to its cleared state. After any
reset, the interrupt mask i s set and can only be clea red by a sof tware
instruction. See Section 3. Resets and Interrupts.
N — Negative Flag
The CPU sets t he negative fl ag when an ar it hmet ic ope rati on , log ical
operation, or data manipulation produces a negative result.
Z — Zero Flag
The CPU sets the zero flag when an arithmetic operation, logical
operation, or data manipulation produces a result of $00.
C — Carry/Borrow Flag
The CPU sets the carry/borrow flag when an addition operation
produces a carry out of bit 7 of the accumulator or when a subtraction
operation requires a borrow. Some logical operations and data
manipulation instructions also clear or set the carr y/borrow flag (as in
bit test and branch instructions and shifts and rotates).
CPU08 — Rev. 3.0Ref erence Manual
MOTOROLAArchitecture 29
Architecture
2.4 CPU08 Functional Description
This subsection is an overview of the architectur e of the M68HC08 CPU
with functional descriptions of the major blocks of the CPU.
The CPU08, as shown in Figure 2-7, is divided into two main blocks:
•Control unit
•Execution unit
The control unit contains a finite state machine along with miscellaneou s
control and timing logic. The outputs of this block drive the execution
unit, which contains the arithmetic logic unit (ALU), registers, and bus
interface.
CONTR OL UNIT
CONTROL
SIGNALS
EXECUTION UNIT
STATUS
SIGNALS
ADDRESS BUS
Figure 2-7. CPU08 Block Diagram
INTERNAL
DATA BUS
INTER NAL
Reference ManualCPU08 — Rev. 3.0
30ArchitectureMOTOROLA
Loading...
+ 214 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.