Go to Triangle Digital Support Home Page TDS2020F TECHNICAL MANUAL
Hardware support
Extended memory
Live website search
Enter key words
 

EXTENDED MEMORY

DEFINITIONS

!!

( n addr - )

(#EXTVAR.TDS) Store n at address in extended memory

@@

( addr - n )

(#EXTVAR.TDS) Fetch n from address in extended memory

+!!

( n addr - )

(#EXTVAR.TDS) Add n to address in extended memory

2!!

( d addr - )

(#EXTVAR.TDS) Store 32-bit data d at address in extended memory

2@@

( addr-d )

(#EXTVAR.TDS) Fetch 32-bit data d from address in external memory

2VARIABLE

( - )

(#EXTVAR.TDS) Redefinition to put 32-bit variables in extended memory

E!

( n d-addr - )

Store 16-bit data n at 32-bit double address d-addr

E@

( d-addr - n )

Fetch 16-bit data n from 32-bit double address d-addr

EC!

( b d-addr - )

Store 8-bit byte b at 32-bit double address d-addr

EC@

( d-addr - b )

Fetch 8-bit byte b from 32-bit double address d-addr

EDUMP

( d-addr u - )

Display the memory content of u successive addresses starting at double number address d-addr. Examine any part of the memory.

EEC!

( b d-addr - )

(#EEPROM.TDS) Program 32-bit EEPROM memory address d-addr with byte b.

EEC@

( d-addr - b )

(#EEPROM.TDS) read byte b from EEPROM memory 32-bit address d-addr

ELOCK

( d-addr - )

(#ELOCK.TDS) Use a lock byte at d-addr in extended memory to prevent access to following code by another task. See COMMON RESOURCES, page 181

EUNLOCK

( d-addr - )

(#ELOCK.TDS) Use a lock byte at d-addr in extended memory to free access by another task. See COMMON RESOURCES, page 181

SFC!

( b d-addr - )

(#28SF040.TDS) Program 32-bit Flash memory address d-addr with byte b.

SFERASE

( da d --   )

(#28SF040.TDS) Erase d (32-bit) bytes from Flash memory 32-bit address d-addr

SFEXPOSE

( - )

(#28SF040.TDS) Allow writes to Flash chip

SFMOVE

( a da u --  )

(#28SF040.TDS) Page 0 to Flash chip block transfer

SFPROTECT

( - )

(#28SF040.TDS) Disables writes to Flash chip

SFSCRUB

( - )

(#28SF040.TDS) Erases entire Flash chip

VARIABLE

( - )

(#EXTVAR.TDS) Redefinition to put variables in extended memory

FILES

#EEPROM.TDS

EEPROM memory chip support

#ELOCK.TDS

(comes with Update Service) Provides binary semaphores when using extended memory variables in a multitasking system

#EXTMEM.TDS

Assembler source code for addressing extended memory

#EXTUTIL.TDS

Data move utilities for extended memory

#EXTVALU.TDS

VALUE and TO system of variables using extended memory

#EXTVAR.TDS

Allows variables to be placed in extended RAM

#28SF040.TDS

512k byte Flash memory chip support

 

Also see COMMON RESOURCES, page 181, and DATA LOGGING TO RAM PCMCIA CARDS, page 274.

INSTALLING EXTENDED MEMORY

These are the order codes of typical chips you can put into the 32-pin socket:

 

28SF040

512k byte Flash

 

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 MEMORY

Extended 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:

 

8k bytes 28-pin

FE000 to FFFFF

 

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:

 

Memory type

Utility to include

Words provided

RAM

None

EEPROM

Flash

#28SF040.TDS

SFC! and redefinitions of EC! EC! 2E!

NON-VOLATILE RAM

EEPROM 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 EXPANSION

The 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.

Go to Triangle Digital Support Home Page Go to top   Next page