Microcontroller Architecture PIC18F Family: ELEC 330 Digital Systems Engineering Dr. Ron Hayne
Microcontroller Architecture PIC18F Family: ELEC 330 Digital Systems Engineering Dr. Ron Hayne
Microcontroller Architecture PIC18F Family: ELEC 330 Digital Systems Engineering Dr. Ron Hayne
PIC18F Family
ELEC 330
Digital Systems Engineering
Dr. Ron Hayne
Images Courtesy of Ramesh Gaonkar and Delmar Learning
PIC18F Microcontrollers
Microcontroller Unit (MCU)
I/O ports
Support devices such as timers
330_02
Microcontroller Unit
330_02
330_02
Microprocessor Unit
Includes Arithmetic Logic Unit (ALU),
Registers, and Control Unit
decoder
16-bit instructions
Status
5-bits
WREG
working register
8-bit accumulator
330_02
Microprocessor Unit
Registers
Program
Counter (PC)
Data Memory
Control unit
Provides
330_02
capacity: 2 MB
capacity: 4 KB
330_02
Control signals
330_02
PIC18F452/4520 Memory
Program Memory: 32 K
Data Memory: 4 K
Data EEPROM
330_02
PIC18F452/4520 Memory
Program Memory
Data Memory
330_02
10
330_02
11
330_02
12
330_02
13
Data Transfer
330_02
14
Serial Communications
A/D converter
Parallel Slave Port (PSP)
Data EEPROM
330_02
15
330_02
16
330_02
17
PIC18F4X2
Architecture
Block Diagram
18
330_02
19
330_02
20
PIC18F Instructions
77 assembly language instructions
330_02
21
Instruction Descriptions
Copy (Move) 8-bit number (Literal) into W register
Binary format:
330_02
22
Illustrative Program
Problem statement:
Hardware:
PORTC
Bidirectional
330_02
23
Illustration
Interfacing LEDs to PORTC
330_02
24
Illustration
Program (software)
MOVLW
MOVWF
MOVLW
00
TRISC
0x55
MOVWF
SLEEP
PORTC
;Turn on LEDs
;Power down
330_02
25
Illustration
Address
Hex
Mnemonics
Comments
000000
0E00
MOVLW 00
;Load W with 0s
000002
6E94
MOVWF TRISC
000004
0E55
MOVLW 0x55
000006
6E82
MOVWF PORTC
;Turn on LEDs
000008
0003
SLEEP
;Power Down
330_02
26
Illustration
Execution of the
instruction:
MOVWF PORTC
330_02
27
330_02
28
Embedded System
MCU-based
System
330_02
29