Datasheet

to 0x90FF. This is illustrated in the figure below. Memory configuration B refers to the ATmega103
compatibility mode, configuration A to the non-compatible mode.
When the device is set in Atmel AVR ATmega103 compatibility mode, the internal address space is 4,096
bytes. This implies that the first 4,096 bytes of the external memory can be accessed at addresses
0x8000 to 0x8FFF. To the Application software, the external 32 Kbytes memory will appear as one linear
32 Kbytes address space from 0x1000 to 0x8FFF.
Figure 12-10 Address Map with 32Kbytes External Memory
0x0000
0x10FF
0xFFFF
0x1100
0x7FFF
0x8000
0x90FF
0x9100
0x0000
0x10FF
0x1100
0x7FFF
Memory Configuration A
Memory Configuration B
Internal Memory
(Unused)
AVR Memory Map
Externa l 32K SRAM
External
Memory
0x0000
0x0FFF
0xFFFF
0x1000
0x7FFF
0x8000
0x8FFF
0x9000
0x0000
0x0FFF
0x1000
0x7FFF
Internal Memory
(Unused)
AVR Memory Map
Externa l 32K SRAM
External
Memory
12.6.9. Using all 64 Kbytes Locations of External Memory
Since the External Memory is mapped after the Internal Memory as shown in Figure 12-4 External
Memory with Sector Select on page 35, only 60Kbytes of External Memory is available by default
(address space 0x0000 to 0x10FF is reserved for internal memory). However, it is possible to take
advantage of the entire External Memory by masking the higher address bits to zero. This can be done by
using the XMMn bits and control by software the most significant bits of the address. By setting Port C to
output 0x00, and releasing the most significant bits for normal Port Pin operation, the Memory Interface
will address 0x0000 - 0x1FFF. See the following code examples.
Assembly Code Example
(1)
; OFFSET is defined to 0x2000 to ensure
; external memory access
; Configure Port C (address high byte) to
; output 0x00 when the pins are released
; for normal Port Pin operation
ldi r16, 0xFF
out DDRC, r16
ldi r16, 0x00
out PORTC, r16
; release PC7:5
Atmel ATmega64A [DATASHEET]
Atmel-8160E-ATmega64A_Datasheet_Complete-09/2015
40