PIC18F2331/2431/4331/4431
6.1
Program Memory Organization
6.0
MEMORY ORGANIZATION
PIC18 microcontrollers implement a 21-bit program
counter that can address a 2-Mbyte program memory
space. Accessing a location between the upper bound-
ary of the physically implemented memory and the
2-Mbyte address will return all ‘0’s (a NOPinstruction).
There are three memory types in enhanced MCU
devices. These memory types are:
• Program Memory
• Data RAM
• Data EEPROM
The PIC18F2331/4331 devices each have 8 Kbytes of
Flash memory and can store up to 4,096 single-word
instructions.
As Harvard architecture devices, the data and program
memories use separate buses, enabling concurrent
access of the two memory spaces. The data EEPROM,
for practical purposes, can be regarded as a peripheral
device, since it is addressed and accessed through a
set of control registers.
The PIC18F2431/4431 devices each have 16 Kbytes
of Flash memory and can store up to 8,192 single-word
instructions.
PIC18 devices have two interrupt vectors. The Reset
vector address is at 000000h and the interrupt vector
addresses are at 000008h and 000018h.
Additional detailed information on the operation of the
Flash program memory is provided in Section 8.0
“Flash Program Memory”. Data EEPROM is
discussed separately in Section 7.0 “Data EEPROM
Memory”.
The program memory maps for PIC18F2331/4331 and
PIC18F2431/4431 devices are shown in Figure 6-1
and Figure 6-2, respectively.
FIGURE 6-2:
PROGRAM MEMORY MAP
AND STACK FOR
PIC18F2431/4431
FIGURE 6-1:
PROGRAM MEMORY MAP
AND STACK FOR
PIC18F2331/4331
PC<20:0>
21
PC<20:0>
21
CALL,RCALL,RETURN
RETFIE,RETLW
CALL,RCALL,RETURN
RETFIE,RETLW
Stack Level 1
Stack Level 1
Stack Level 31
Stack Level 31
000000h
000008h
000018h
Reset Vector LSb
000000h
Reset Vector LSb
High-Priority Interrupt Vector LSb
Low-Priority Interrupt Vector LSb
000008h
000018h
High-Priority Interrupt Vector LSb
Low-Priority Interrupt Vector LSb
On-Chip Flash
Program Memory
On-Chip Flash
Program Memory
001FFFh
002000h
003FFFh
004000h
Unused
Read ‘0’s
Unused
Read ‘0’s
1FFFFFh
1FFFFFh
2010 Microchip Technology Inc.
DS39616D-page 61