|
||
EXTENDED MEMORYDEFINITIONS
FILES
Also see COMMON RESOURCES, page 181, and DATA LOGGING TO RAM PCMCIA CARDS, page 274. INSTALLING EXTENDED MEMORYThese are the order codes of typical chips you can put into the 32-pin socket:
When installing a memory chip in this socket see PCB LINKS, page 48, and make the solder links accordingly. If the chip only has 28 pins, leave the four free sockets towards the edge of the board-the chip should be inserted towards the inside of the TDS2020F card. ACCESSING EXTENDED MEMORYExtended memory in the TDS2020F is any chip up to 512k bytes fitted in the 32-pin socket memory or mapped into the same space address hex 80000-FFFFF. If smaller memories are used address them as follows:
The TDS2020F has 1024 kilobytes of memory space. High-level Forth operates in the first 64k bytes and the rest can be used for data collection (or assembler program). The words shown above give access to all the memory, including the first 64k bytes. Note that a 32-bit double number address is required. For example to examine the first part of your application program at address 08800 try this (note the dot after the 08800, which makes it a double number). Part of the resulting display is also seen (the interrupt jump table in fact):
. etc.
E! EC! E@ EC@ act just like ! C! @ C@ except that a double number is used so that the whole memory can be reached. For example:
will show you an area of memory containing it. E! and EC! will work with RAM but not Flash or EEPROM, see below. The words EC! EC@ E! E@ are built into the Forth ROM, however file #EXTMEM.TDS has the source code so that you can see the technique for use in your own assembler routines. If you are short of variables in the first 64k of memory you can redefine VARIABLE and gain access using words defined in #EXTVAR.TDS. E.g.
VARIABLE FRED \ define new variable 1234 FRED !! \ store a number in it FRED @@ \ retrieve value of variable 2 FRED +!! \ add 2 to the variable STATE @ \ get value of a system variable
You can use both types of variable, just add INCLUDE #EXTVAR.TDS in your program after defining any variables you need to be in the first 64k. As an alternative, #EXTVALU.TDS provides the VALUE and TO system of variables using extended memory. Words used to address the memory depend on its type. If not RAM include the appropriate utility in your application program and use the words provided there:
NON-VOLATILE RAMEEPROM and Flash are inherently non-volatile but a RAM needs a battery to keep its data. The TDS2020BYN battery module plugs into the top of a TDS2020F and gives at least 5 years life. Alternatively connect a battery of 2.0 to 5.0V to the VBATT (pin z3)-the TDS2020BYD is a convenient external battery board incorporating appropriate safety resistors. Current taken (including on-board clock) is about 3.5�A. The TDS2020F contains circuitry to ensure that data should not be lost from a RAM in the 32-pin socket when the power is removed or restored but in critical cases add a simple checksum or extra error-recovery data to your stored information. EXTENDED MEMORY EXPANSIONThe 32-pin socket can be temporarily switched out of the memory space, allowing the 80000 to FFFFF area to be used by external memory. In this way the memory can be expanded indefinitely. To enable the facility make link Q and unmake link P. Parallel Port P17 (pin c28) can now be used to control access to the on-board memory. When it outputs a logic 1 the on-board memory is enabled, and a logic 0 disables it. These logic levels can at the same time control the external memory. A 512k byte chunk of the total memory, which can be many megabytes in total, will be available at any one time. In this way you can make a custom solid-state memory array for data collection applications. |