English
Language : 

ATMEGA640 Datasheet, PDF (33/407 Pages) ATMEL Corporation – 8- BIT Microcontroller with 256K Bytes In-System Programmable Flash
ATmega640/1280/1281/2560/2561
External Memory Control
Register A – XMCRA
Figure 19. External Data Memory Cycles with SRWn1 = 1 and SRWn0 = 1(1)
T1
T2
T3
T4
T5
System Clock (CLKCPU)
ALE
T6
T7
A15:8 Prev. addr.
Address
DA7:0 Prev. data
Address XX
Data
WR
DA7:0 (XMBK = 0) Prev. data
Address
Data
DA7:0 (XMBK = 1) Prev. data
Address
Data
RD
Note:
1. SRWn1 = SRW11 (upper sector) or SRW01 (lower sector), SRWn0 = SRW10 (upper
sector) or SRW00 (lower sector).
The ALE pulse in period T7 is only present if the next instruction accesses the RAM
(internal or external).
Bit
Read/Write
Initial Value
7
SRE
R/W
0
6
SRL2
R/W
0
5
SRL1
R/W
0
4
SRL0
R/W
0
3
SRW11
R/W
0
2
SRW10
R/W
0
1
SRW01
R/W
0
0
SRW00
R/W
0
XMCRA
• Bit 7 – SRE: External SRAM/XMEM Enable
Writing SRE to one enables the External Memory Interface.The pin functions AD7:0,
A15:8, ALE, WR, and RD are activated as the alternate pin functions. The SRE bit over-
rides any pin direction settings in the respective data direction registers. Writing SRE to
zero, disables the External Memory Interface and the normal pin and data direction set-
tings are used.
• Bit 6..4 – SRL2:0: Wait-state Sector Limit
It is possible to configure different wait-states for different External Memory addresses.
The external memory address space can be divided in two sectors that have separate
wait-state bits. The SRL2, SRL1, and SRL0 bits select the split of the sectors, see Table
4 and Figure 14. By default, the SRL2, SRL1, and SRL0 bits are set to zero and the
entire external memory address space is treated as one sector. When the entire SRAM
address space is configured as one sector, the wait-states are configured by the
SRW11 and SRW10 bits.
33
2549A–AVR–03/05