Utilizing External RAM
Posted: 22 February 2007, 18:00 PM
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.
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.
Code: Select all
Option ExtRamConfig On
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.