EasyManuals Logo

Atmel AVR AT90CAN32 User Manual

Atmel AVR AT90CAN32
428 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #35 background imageLoading...
Page #35 background image
35
7679H–CAN–08/08
AT90CAN32/64/128
4.5.9 Using all 64KB Locations of External Memory
Since the External Memory is mapped after the Internal Memory as shown in Figure 4-4, only
(64K-(“ISRAM size”+256)) bytes of External Memory is available by default (address space
0x0000 to “ISRAM end” is reserved for internal memory). However, it is possible to take advan-
tage 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 - 0x1FFF. See the following code examples.
Note: 1. The example code assumes that the part specific header file is included.
Care must be exercised using this option as most of the memory is masked away.
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
ldi r16, (1<<XMM1)|(1<<XMM0)
sts XMCRB, r16
; write 0xAA to address 0x0001 of external
; memory
ldi r16, 0xaa
sts 0x0001+OFFSET, r16
; re-enable PC7:5 for external memory
ldi r16, (0<<XMM1)|(0<<XMM0)
sts XMCRB, r16
; store 0x55 to address (OFFSET + 1) of
; external memory
ldi r16, 0x55
sts 0x0001+OFFSET, r16
C Code Example
(1)
#define OFFSET 0x2000
void XRAM_example(void)
{
unsigned char *p = (unsigned char *) (OFFSET + 1);
DDRC = 0xFF;
PORTC = 0x00;
XMCRB = (1<<XMM1) | (1<<XMM0);
*p = 0xaa;
XMCRB = 0x00;
*p = 0x55;
}

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Atmel AVR AT90CAN32 and is the answer not in the manual?

Atmel AVR AT90CAN32 Specifications

General IconGeneral
BrandAtmel
ModelAVR AT90CAN32
CategoryMicrocontrollers
LanguageEnglish

Related product manuals