Documente Academic
Documente Profesional
Documente Cultură
SYSTEM
APPLICATIONS
CHAPTER 2 MICROCONTROLLER ARCHITECTURE
& ASSEMBLY LANGUAGE PROGRAMMING
Explain the file register, instruction sets, status register,
data format and directives. Describe and apply the MPLAB
IDE compiler in the assembly language programming.
hafriz.fikrie@gmail.com
Pg 1
Pg 2
Pg 3
Part 1 of 2
Pg 4
Part 2 of 2
Pg 5
Interface
Controller".
Pg 6
http://www.mi
kroe.com/chap
ters/view/74/
Pg 7
Pg 8
Pg 9
Pg 10
Pg 11
Pg 12
Pg 13
Pg 16
Pg 17
Pg 18
Slide 15
Pg 19
Pg 20
Pg 24
Pg 25
Pg 26
Pg 27
Pg 28
Pg 29
in hex
Decimal.
Two ways to represent. MOVLW D12 , (in hex
0x0C)
Or MOVLW .12
PIC18 Microcontroller and Embedded Systems using Assembly & C: Pg. 62
Pg 32
Pg 35
Pg 37
Pg 39
25H
ADDLW
34H)
34H
; add value 34 to W (W = W +
Pg 43
TO BE CONTINUED..
Pg 44
operations
Bit-oriented operations
Literal operations
Control operations
Pg 46
Pg 47
Pg 48
Pg 50
Datasheet PIC18F458
MOVWF
F is stands for file register. While W stand for working
register..
Tells the CPU to copy W file reg.
Eg. MOVWF PORTA ;Means copy 8-bit data in w into PORTA
file reg.
MOVLW
MOVWF
Pg 51
D10 ; in W = ??
D01
PORTA ; now PORTA = ??
Pg 52
Pg 53
Pg 54
Pg 56
Formula:
Destination = filereg + WREG
Pg 57
Pg 58
Pg 59
Pg 60
Pg 61
Pg 62
Refer Datasheet
Pg 63
Refer Datasheet
Pg 64
Pg 65
Pg 66
Formula:
Destination = filereg - 1
Pg 67
Formula:
Destination = filereg - 1
Pg 68
Formula:
Destination = filereg + 1
Pg 69
Pg 70
Pg 71
Pg 72
MOVWF
ADDWF
COMF
DECF & INCF
MOVF
MOVFF
Literal Operations
MOVLW
ADDLW
Pg 73
Pg 74
Pg 75
Pg 77
Pg 78
Pg 79
3FFF
Pg 80
0000
OPCODE here
FFFF
00000
221 1 = 2097151 = 2M
1FFFF
F
Pg 81
Pg 82
Pg 83
Pg 84
address
16-bit
size data
bus
Pg 87
Von Neumann
Architecture
Harvard Architecture
Pg 88
MOVLW
2-byte instruction.
MOVLW = 0E 1-byte
k = any literal number 1-byte
address
2-byte instruction.
ADDLW = 0F 1-byte
k = any literal number 1-byte
MOVWF
2-byte instruction.
MOVWF= 6E 1-byte
k = any literal number 1-byte
Pg 91
Pg 93
Pg 95
Pg 96
Pg 97
Pg 98
Pg 99
Pg 100
Pg 101
Page 162
SUBFWB
Pg 102
Pg 103
Data sheet
PIC18F458 pg 9
Pg 104
Pg 105
Pg 106
Pg 107
0x47
0x25
;
; WREG = 6C
; WREG = 72
Pg 112
Pg 114
Pg 115
Pg 116
Pg 117
Pg 118
Thank you..
hafriz.fikrie@gmail.com
Pg 119