TH The Processor
TH The Processor
The processor
Th
DEMO
: Purchase
Registers -- storage locations in the processor
: Purchase
Arithmetic logic unit
from www.A-PDF.com
Control unit
from www.A-PDF.com
pprogram
g counter contains the address of the next instruction to be executed
status register flags the instruction execution result
The microprocessor
to remove
to remove
A processor implemented on a very large scale integration (VLSI) chip
the watermark
Peripheral chips are needed to construct a product
the watermark
The Microcontroller
The processor and peripheral functions implemented on one VLSI chip
10 – 12 MIPS
Up to 128 KB Program Flash
18 – 100 Pins
Embedded Systems
• Harvard
– Separate data and program memory space (busses)
• Von-Neumann
– Only one bus between CPU and memory
Von Neumann
Harvard
Architecture Architecture
16-bit Bus
CPU 8-bit Bus Program
& Data
Memory
Program CPU
Memory
• RISC
– A minimal set of simple instructions when combined can
accomplish every needed operation
• CISC
– A large set of complex instructions can singularly provide all
needed operations
Program
Peripherals
Flash
Program Bus Data Bus
16-bit 8-bit CPU 8-bit
I/O Ports
007FFEh
Stack Level 2
Stack Level 30
Unimplemented
Stack Level 31
Program Memory
(Read as ‘0’)
31 Level Stack
1FFFFEh
Bank 1 GPR
Bank 2 GPR
ACCESS RAM
ACCESS SFR
Bank 13 GPR
Bank 14 GPR
Bank 15 GPR
ACCESS SFR
• Status register
– Contains arithmetic status of the ALU
– Bits set or cleared according to the device logic
w f 07h
ALU 08h
09h
Data Bus
0Ah
0Bh
d
w f 0Ch
0Dh
0Eh
0Fh
10h
WREG
Decoded Instruction
Opcode d a Address
from Program
Memory:
Arithmetic/Logic Function
to be Performed Result
Destination
sschneider@udayton.edu ECT 358 Microprocessors II
The PIC18 Microcontroller
Instruction Format
15 10 9 8 7 0
opcode d a f
Byte-to-byte Operations
Figure 1.9 Byte to byte move operations (2 words) (redraw with permission of Microchip)
15 12 11 9 8 7 0
opcode b a f
Literal operations
15 8 7 0
opcode k
Control operations
- These instructions are used to change the program execution sequence and
making subroutine calls.
15 8 7 0
Access Bank
Add Instructions
addwfc
dd f PRODL W A
PRODL,W,A ; add
dd WREG,
WREG PRODL,
PRODL and
d carry and
d lleave sum
; in WREG
Subtract Instructions
subfwb PRODL F
PRODL,F ; PRODL [WREG] – [PRODL] – borrow flag
RISC CISC
R l andd fixed
Regular fi d instruction
i t ti format
f t Irregular instruction format
Separated data and program memory Combined data and program memory
Most operations are register to register Most operations can be register to memory
Take shorter time to design and debug Take longer time to design and debug
Provide large number of CPU registers Provide smaller number of CPU registers