CONFIG XRAM

Top  Previous  Next

Action

Instruct the compiler to set options for external memory access.

 

 

Syntax

CONFIG XRAM = mode  [ , WaitstateLS=wls , WaitStateHS=whs ]

 

 

Remarks

Mode

The memory mode. This is either enabled or disabled. By default, external memory access is disabled.

Wls

When external memory access is enabled, some chips allow you to set a wait state. The number of modes depend on the chip. A modern chip such as the Mega8515 has 4 modes :

0 - no wait states

1 - 1 cycle wait state during read/write

2 - 2 cycle wait state during read/write

3 - 2 cycle wait state during read/write and 1 before new address output

 

WLS works on the lower sector. Provided that the chip supports this.

Whs

When external memory access is enabled, some chips allow you to set a wait state. The number of modes depend on the chip. A modern chip such as the Mega8515 has 4 modes :

0 - no wait states

1 - 1 cycle wait state during read/write

2 - 2 cycle wait state during read/write

3 - 2 cycle wait state during read/write and 1 before new address output

 

WHS works on the high sector. Provided that the chip supports this.

 

Wait states are needed in case you connect equipment to the bus, that is relatively slow. Especial older electronics/chips.

Some AVR chips also allow you to divide the memory map into sections. By default the total XRAM memory address is selected when you set a wait state.

 

The $XA directive should not be used anymore. It is the same as CONFIG XRAM=Enabled.

 

noticeWhen using IDLE or another power down mode, it might be needed to use CONFIG XRAM again, after the chip wakes from the power down mode.

 

See also

$XA , $WAITSTATE

 

 

ASM

NONE

 

 

Example

CONFIG XRAM = Enabled, WaitstateLS=1 , WaitstateHS=2