Lecture 2 The PIC16F877 Memory Map & Assembly Programming
Lecture 2 The PIC16F877 Memory Map & Assembly Programming
Lecture 2 The PIC16F877 Memory Map & Assembly Programming
Memory Maps
Data RAM Organization
• Data RAM address space is partitioned into 4 banks of
128 bytes/file registers each:
SFRs
GPRs
Data RAM Organization
Core
SFRs
Peripheral
SFRs
Working
Space
Core SFRs
STATUS
(03h, 83h, 103h, 183h)
IRP RP1 RP0 T0 PD Z DC C
INDF effects
the indirect
addressing
OPTION_REG
(81h, 181h)
/RBPU INTEDG T0CS T0SE PSA PS2 PS1 PS0
Timer 0
Source Timer 0
Edge
Weak Interrupt
Pullups Source
OPTION_REG
(81h, 181h)
/RBPU INTEDG T0CS T0SE PSA PS2 PS1 PS0
Prescaler
Prescaler bits
Assignment
INTCON
(0Bh, 8Bh, 10Bh, 18Bh)
GIE PEIE TMR0IE INTE RBIE TMR0IF INTF RBIF
Individual Interrupt
Enable Bits flags
INTCON
(0Bh, 8Bh, 10Bh, 18Bh)
GIE PEIE TMR0IE INTE RBIE TMR0IF INTF RBIF
Peripheral Interrupt
Enable
Global Interrupt
Enable
Peripheral Interrupt Enable Bits
PIE1 (8Ch)
PIE2 (8Dh)
PIR2 (0Dh)
Power on
reset bit Brown out
reset bit
Program Counter
• Program counter is 13 bits wide.
Looping
loop: DECFSZ 51,1 ; decrement & test
GOTO loop ; loop if not zero
Tutorial Exercise 1
Do all questions from Chapter 2 Tutorial
Questions and submit the following via Google
Classroom