ATMEGA2561V ATMEL [ATMEL Corporation], ATMEGA2561V Datasheet - Page 31

no-image

ATMEGA2561V

Manufacturer Part Number
ATMEGA2561V
Description
8-bit Microcontroller with 64K/128K/256K Bytes In-System Programmable Flash
Manufacturer
ATMEL [ATMEL Corporation]
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
ATMEGA2561V-8AI
Manufacturer:
Atmel
Quantity:
10 000
Part Number:
ATMEGA2561V-8AU
Manufacturer:
Atmel
Quantity:
10 000
Part Number:
ATMEGA2561V-8AU
Manufacturer:
ALTERA
0
Part Number:
ATMEGA2561V-8AU
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Part Number:
ATMEGA2561V-8AUR
Manufacturer:
Atmel
Quantity:
10 000
Part Number:
ATMEGA2561V-8MI
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Part Number:
ATMEGA2561V-8MU
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Using all 64KB Locations of
External Memory
2549K–AVR–01/07
Since the External Memory is mapped after the Internal Memory as shown in Figure 13,
only 56KB of External Memory is available by default (address space 0x0000 to 0x21FF
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 set-
ting Port C to output 0x00, and releasing the most significant bits for normal Port Pin
operation, the Memory Interface will address 0x0000 - 0x2FFF. See the following code
examples.
Care must be exercised using this option as most of the memory is masked away.
Note:
Assembly Code Example
C Code Example
#define OFFSET 0x4000
void XRAM_example(void)
{
}
; OFFSET is defined to 0x4000 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
out
ldi
out
; release PC7:6
ldi
sts
; write 0xAA to address 0x0001 of external
; memory
ldi
sts
; re-enable PC7:6 for external memory
ldi
sts
; store 0x55 to address (OFFSET + 1) of
; external memory
ldi
sts
unsigned char *p = (unsigned char *) (OFFSET + 1);
DDRC = 0xFF;
PORTC = 0x00;
XMCRB = (1<<XMM1);
*p = 0xaa;
XMCRB = 0x00;
*p = 0x55;
1. See “About Code Examples” on page 9.
r16, 0xFF
DDRC, r16
r16, 0x00
PORTC, r16
r16, (1<<XMM1)
XMCRB, r16
r16, 0xaa
0x0001+OFFSET, r16
r16, (0<<XMM1)
XMCRB, r16
r16, 0x55
0x0001+OFFSET, r16
(1)
ATmega640/1280/1281/2560/2561
(1)
31

Related parts for ATMEGA2561V