Professional Documents
Culture Documents
PC MCU
CPU- brain of the CPU – brain of the system
system Memory – store program
Hard drive/RAM specific to single task
Clock - speed of System Clock
CPU, processing of (oscillator) – computer’s
info engine
Peripherals – Resolution, response
input information and power consumption
keyboard, mouse, etc. Peripherals – associated
with a particular pin in the
package
16 bits
Data Memory PIC18 Program Memory
Width Width
14 bits
8 bit PIC16
MCU PIC12F
12 bits
PIC16C5X
PIC12C5XX
Fetch SUB_1
Instruction rate is
1/4 of the input fosc
PIC MCU
clock
4 MHz
(250 ns)
Input oscillator
frequency is Tcy
called fosc
An instruction 1 MHz
cycle takes 1 Tcy (1 us)
2 types of memory
Program
Data (RAM and EEPROM)
Organization
Pages (program memory)
Banks (data memory)
FLASH RAM
Program Memory Data Memory
PICmicro MCU Code Size (words) GPR Size (bytes)
PIC12F675 1K 64
PIC16F877A 8K 368
OP CODE k k k k k k k k k k k
5
movlw HIGH Delay
movwf PCLATH PCLATH <5> 8
OP CODE f f f f f f f
2-bits From
STATUS
Register 7-bits From Instruction Word
RP1 RP0 f f f f f f f
Up to Four banks
Bank0 Bank1 Bank2 Bank3
each of 128 bytes
SFRs 000h
of Data Memory
SFRs 080h SFRs 100h SFRs 180h
Special Function
Registers (SFRs)
01Fh
020h
09Fh
0A0h
11Fh
120h
19Fh
1A0h
are mapped in top
32 locations
GPRs GPRs GPRs
GPRs
Banks selected by
07Fh
0F0h
0FFh
170h
17Fh
1F0h
1FFh
RP0,1 and IRP in
RP<1:0> RP<1:0> RP<1:0> RP<1:0> Status register
= 00 = 01 = 10 = 11
0A
PICmicro
PCLATH PCLATH 8A
0B INTCON INTCON 8B
0C PIR1 PIE1 8C
0D 8D
Architecture 0E
0F
TMR1L
TMR1H
PCON 8E
8F
Bank 0 Bank 1
1-bit From
STATUS
8-bits From FSR
Register
IRP f f f f f f f f
22 21 22 21
22 22
FSR 23 5 FSR 23 5
24 24
5 5
INDF INDF
movlw 22 movlw 22
movwf FSR movwf FSR
movlw 5 movf INDF,W
movwf INDF movwf 5
35 Instructions
Easy to learn
High compaction
Very powerful single-word instructions
Upward compatibility of instructions
f = File Register, k = literal value (8-bit), b = bit address <0 to 7>, d = destination (W or file register)
Bit-Oriented
Operations 14-bit Instruction for Bit Oriented Operations