How to erase a RAM card in the 48GX?


I want to completely erase a RAM card. How do you do it?


The easiest way is to remove the card from the calculator and remove the backup battery. Otherwise, you'll need to PURGE each individual file on the card.

If you remove the battery, you'll need to do PINIT after you put the card back in the calculator, or else you'll get an 'Invalid Card Data' error every time you turn it on.


I'm not sure how long a RAM card has to be left without power before it loses memory, but, as Wayne noted, that's no doubt the easiest way to clear one. Note that with the card inserted and the calculator turned on, the card gets its power from the calculator. Some SMI and TDS cards use a non-removable rechargeable battery (recharged by a turned-on calculator), which (if fully charged) should hold its charge for a month or so. For the 48GX's slot 1, be sure that port 1 is "free" (see below) before removing the card (or its battery).

Of course when a card is powered up again, it will contain random data. To easily "organize" the memory of all ports in a 48GX, use the PINIT command.

If you choose to clear the card by purging objects, of course first off, the card has to be write-enabled.

For the 48GX's slot 1, port 1 has to be "free", not "merged" with system RAM, to use it as an independent memory port. To check, do 1 PVARS; if this returns a list to level 2 and a number to level 1, then port 1 is already free. If 1 PVARS returns { } to level 2 and "SYSRAM" to level 1, then port 1 is merged. To free (and clear) a merged port 1, do {} FREE1 (or {} 1 FREE). Port 1 can be merged by the MERGE1 command (or 1 MERGE), but note that will also move anything that was in port 1 to port 0.

Port objects "in use", for example, referenced on the stack, by a local environment, a "user-defined" error message, or as an attached library, cannot be purged. A warmstart ([ON] and [C] together) may be the easiest way to make sure that nothing is referenced except auto-attaching libraries. For the libraries, maybe use the LIBS command to get a list of the attached libraries and the DETACH command (which can also take a list of library numbers as its argument) to detach all libraries in the port(s) that you want to clear. Note that if the 48 series is turned off (even an automatic turn-off) and back on again, then any library configuration routines will be run, and most libraries will auto-attach.

To purge a port variable ("backup object"), use it's port-tagged named, for example :1:TEST PURGE. To purge a library, use its port-tagged library number instead, for example, :1:999 PURGE.

The PURGE command can also take a list of port-tagged names and library numbers, and, with a free port, the PVARS command returns a list of the port-tagged names and library numbers of all objects stored in a given port to level 2, followed by its available capacity in level 1. So, for example, 1 PVARS DROP PURGE should clear everything in port 1, unless something there is still referenced, in which case it will stop purging with an "Object In Use" error.

The slot 1 card can have only a single port, but the slot 2 card of a 48GX may have multiple ports of 128KiB each. If you want to purge everything on a multi-port card, you could loop through all ports and clear them with one command line or program, but it may be just as easy to handle each one separately.

Some TDS cards have multiple banks of 128KiB each, but with only one bank at a time available as a port. These are intended for the 48SX, but they work in the 48GX. These cards include a SWITCH library, to control which bank is available as a port. For these, it may be best to leave a copy of the SWITCH library in each bank (unless the card is going to be stored without power). For these, start with bank 1, clear the port, then switch to the next bank and clear the port again, and so on. If you have one of these cards, then it's best to have the SWITCH library safely backed up to your PC at least.

Oliver Klotz makes (made?) a 4MiB (32-bank) card for the 48GX's slot 2, with 30 banks available at a time as ports 2 through 31, and a physical switch on the card to control which 2 banks are used as ports 30 and 31. Of course in this case you'd clear ports 2 through 31, and then toggle the switch and clear ports 30 and 31 again.

There's also a multi-bank Klotz card intended for the 48SX (but usable in a 48GX) with only one 128KiB bank (selected by physical switch settings) at a time available as a port. These can be treated much like the TDS multi-bank cards.

For a 48SX the above would mostly apply, except that its slot 2 is like the 48GX's slot 1, and the FREE1 and MERGE1 commands aren't available, so the FREE and MERGE commands would have to be used instead. The 48SX also doesn't include the PINIT command, so to "organize" a card's memory, just store any object in each port, after which the "dummy object" can be purged.


Edited: 28 July 2007, 2:26 a.m.

Possibly Related Threads...
Thread Author Replies Views Last Post
  42S with nonvolatile RAM Lyuka 5 718 12-13-2013, 08:52 AM
Last Post: Lyuka
  Best way to test HP-71B RAM modules (the 32K/96K ones etc.)? Philippe Lasnier 4 662 09-25-2013, 09:54 AM
Last Post: Philippe Lasnier
  HP 2225D+ RAM failure/replacement Luca 4 549 09-10-2013, 01:46 PM
Last Post: Luca
  Questions about building a RAM card for hp 48 Waon Shinyoe (China) 0 301 07-09-2013, 09:53 PM
Last Post: Waon Shinyoe (China)
  RAM Card compatibitlity Ignacio Sánchez 2 359 09-06-2012, 07:20 PM
Last Post: Raymond Del Tondo
  HP41 Card Reader not Pulling Card Colin Verrilli 14 998 07-29-2012, 05:53 PM
Last Post: Randy
  [hp-48gx] Memory card issues. jerome ibanes 1 214 06-03-2012, 11:34 AM
Last Post: NateB
  NoV-64: Can't Access RAM Chip 3 Les Wright 4 458 05-28-2012, 11:06 PM
Last Post: Les Wright
  NoV-64: The Incredible Shrinking HEPAX RAM Les Wright 31 1,727 05-27-2012, 08:48 AM
Last Post: M. Joury
  Replacing Rechargeable Batteries on TDS/SMI RAM cards aj04062 2 341 04-12-2012, 11:20 PM
Last Post: Geoff Quickfall

Forum Jump: