Datasheet
29
4337K–USB–04/08
AT89C5130A/31A-M
8. Program/Code Memory
The AT89C5130A/31A-M implement 16/ 32 Kbytes of on-chip program/code memory. Figure 8-
1 shows the split of internal and external program/code memory spaces depending on the
product.
The Flash memory increases EPROM and ROM functionality by in-circuit electrical erasure and
programming. Thanks to the internal charge pump, the high voltage needed for programming or
erasing Flash cells is generated on-chip using the standard V
DD
voltage. Thus, the Flash Mem-
ory can be programmed using only one voltage and allows In- application Software
Programming commonly known as IAP. Hardware programming mode is also available using
specific programming tool.
Figure 8-1. Program/Code Memory Organization
Note: If the program executes exclusively from on-chip code memory (not from external memory),
beware of executing code from the upper byte of on-chip memory (3FFFh/7FFFh) and thereby
disrupting I/O Ports 0 and 2 due to external prefetch. Fetching code constant from this location
does not affect Ports 0 and 2.
8.1 External Code Memory Access
8.1.1 Memory Interface
The external memory interface comprises the external bus (Port 0 and Port 2) as well as the bus
control signals (PSEN, and ALE).
Figure 8-2 shows the structure of the external address bus. P0 carries address A7:0 while P2
carries address A15:8. Data D7:0 is multiplexed with A7:0 on P0. Table 8-1 describes the exter-
nal memory interface signals.
0000h
32 Kbytes
7FFFh
Flash
32 Kbytes
External Code
FFFFh
AT89C5131A
8000h
0000h
16 Kbytes
3FFFh
Flash
48 Kbytes
External Code
FFFFh
AT89C5130A
4000h