1281e RAM allocation

Discussion specific to the ZX-1281 and ZX-1280 microcontrollers as well as the ZX-1281 and ZX-1280 Dev Boards.
Post Reply
pjc30943
Posts: 220
Joined: 01 December 2005, 18:45 PM

1281e RAM allocation

Post by pjc30943 »

When ExtRamConfig is On, why isn't the external RAM automatically allocated?

When I set RamSize using Register.RamStart, the correct amounts show up in the .map file; when the RAM is enabled only--but the size is not set--extra bytes are not added.

Just curious what physically happens inside the device when the RAM is enabled, but no size is defined.

By the way, the 1281e is a very cool device. Its power is quite amazing given the ease of use. [Of course, it can't compete with something like a dsPIC in performance, and it's not trying to, but dang, its peripherals are so much faster to use for almost anything not extremely demanding.]
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: 1281e RAM allocation

Post by dkinzer »

pjc30943 wrote:When ExtRamConfig is On, why isn't the external RAM automatically allocated?
When the ZX-1281e begins running after reset, it scans the RAM space to try to determine how much RAM is available. Once the RAM size is determined, the value of Register.RAMSize is set. You should be able to see this using the following simple program. Try running it with the RAM daughter card installed and not installed.

Code: Select all

Sub Main()
  Debug.Print "RAM Size = "; CStr(Register.RAMSize)
End Sub
pjc30943 wrote:When I set RamSize using Register.RamStart, the correct amounts show up in the .map file; when the RAM is enabled only--but the size is not set--extra bytes are not added.
Note that 'Option RAMSize' simply tells the compiler how much RAM is available so that it can warn you if you define too many variables. The compiler has no way of knowing if you have the RAM daughter card installed or not - that's why you have to help it out.
pjc30943 wrote:Just curious what physically happens inside the device when the RAM is enabled, but no size is defined.
Unless you specifically limit the amount of external RAM, the maximum amount is made available. It is not particularly useful on the ZX-1281e to restrict the amount of external RAM. In contrast, on the ZX-1281 you might want to do that in order to use the upper address lines for digital I/O.
- Don Kinzer
pjc30943
Posts: 220
Joined: 01 December 2005, 18:45 PM

Post by pjc30943 »

Ah, this is clear now...

Thanks Don.
Post Reply