Chapter 1: 68HC11 MICROCONTROLLER: An of Blocks
Chapter 1: 68HC11 MICROCONTROLLER: An of Blocks
1.1 Introduction
§ 68HC11, an 8-bit microcontroller manufactured by Motorola.
1
1.1 Basic 68HC11 Block Diagram
Address Bus (16-Bit)
Control Control
CPU Memory I/O
Bus Bus
2
1.2 Programming Model of the 68HC11
15 X 0 Index Register X
15 Y 0 Index Register Y
15 PC 0 Program Counter PC
15 SP 0 Stack Pointer SP
S = Stop Disable
S X H I N Z V C Condition Code Register CCR
X = X Interrupt Mask
H = Half Carry C = Carry
I = I Interrupt mask V = Overflow
N = Negative Z = Zero
3
1.2.1 Accumulator A and B
D7 D6 D5 D4 D3 D2 D1 D0
ACCA or
0 1 1 0 0 1 1 1
ACCB
4
1.2.1 Accumulator A and B
Ø Example:
5
1.2.2 Accumulator D
BITS 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 ACCD
ACCA ACCB
§ ACCD represents Accumulator D
§ ACCD = (ACCA + ACCB) to form a 16-bit register.
§ ACCA represents most significant byte (MSByte)
§ ACCB represents least significant byte (LSByte)
6
1.2.3 Index Register X and Y
BITS 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0
INDEX-X or INDEX-Y register
7
1.2.4 Stack Pointer
BITS 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SP
0 0 0 0 1 1 0 0 0 0 1 1 0 1 1 0
register
BITS 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 0 0 0 1 1 0 0 0 0 1 1 0 1 1 0 PC
9
1.2.6 Condition Code Register ( CCR )
D7 D6 D5 D4 D3 D2 D1 D0
S X H I N Z V C CCR
10
Condition Code Register
bit 7 6 5 4 3 2 1 bit 0
S X H I N Z V C CCR
11
§ N (Negative) bit
N = “1” - result of last arithmetic or logical operation
is negative.
- accumulator contents (MSB = “1”)
N =“0” - whenever the result is positive.
- accumulator contents (MSB = “0”)
12
§ Z (Zero) bit
Z = “1” - result of last operation produces zero.
- accumulator content = $00
Z = “0” - result of last operation greater than zero.
- accumulator content == $00
13
§ C (Carry) bit
C =“1” addition or subtraction produces
a carry or a borrow.
C =“0” after addition or subtraction
no carry or no borrow.
*Note: C-bit also used in shift and rotate instructions.
14
§ V(Overflow) bit
V =“1” result is wrong, after
an addition or subtraction using
2’s complement signed number.
15
§ H(Half-carry) bit
H =“1” an 8-bit addition, produces
a carry from bit-3 to bit-4.
H =“0” an 8-bit addition, produces
no carry from bit-3 to bit-4.
16
Review :
1 ) Why is 68HC11 known as an 8 bits microcontroller?
_________________________________________
2) What are the main elements inside the 68HC11?
__________________________________________
3)What is a programming model?
___________________________________________
17