Utilizing External RAM

Discussion specific to the ZX-1281 and ZX-1280 microcontrollers as well as the ZX-1281 and ZX-1280 Dev Boards.
Post Reply
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Utilizing External RAM

Post by dkinzer »

In order to enable the external RAM interface on the ZX-1281 you need to set a configuration word. The simplest way to do this is to add the compiler directive shown below near the top of your main module.

Code: Select all

Option ExtRamConfig On
This enables the external RAM interface using the default configuration - zero wait states, etc. If you need to specify a number of wait states or other configuration, you can specify a decimal or hexadecimal value in place of the On keyword. See the description of the XMCRA and XMCRB registers in the ATmega1281 datasheet and the discussion of Option ExtRamConfig.

When the external RAM interface is enabled, the VM scans external RAM during startup initialization to determine its extent. All of the external RAM is added to the User RAM space at the high end. The VM heap is then initialized at the high end of RAM while the task stacks, etc. are allocated from the low end of RAM.

If external RAM is not enabled, Ports A, C and G can be used for normal I/O.
- Don Kinzer
Post Reply