Ŀ
 Triangle Digital Services Ltd., 223 Lea Bridge Road, LONDON E10 7NE, England 
     Telephone: 0181-539-0285    Fax: 0181-558-8110    CompuServe: 100065,75  
     Internet:  triangle@compuserve.com                                       
                                                                              
 In USA:    Alan Lowne The Saelig Company, 1193 Moseley Road, Victor NY 14564 
            Tel: (716) 425-3753    Fax: (716) 425-3835                        
            CompuServe (sales): 71042,17    CompuServe (technical): 100065,75 
            Internet:  saelig@aol.com                                         
                                                                              
 Web (for latest updates):  http://ourworld.compuserve.com/homepages/triangle 


                         TDS2020 DOCUMENTATION
                         

Complete TDS2020 documentation comprises:

       === New source-code database feature documented below ===
       === New source-code analysis feature documented below ===

   TDS2020TM      Technical Manual, August 1995

   TDS-FLOAT-ANS  Floating Point, March 1995

   TDS-PC         TDS-PC for Windows help (on-line documentation)

   TDS2020CANMAN  TDS2020CAN Technical Manual, March 1997

   TDS2020HM      Hitachi's H8/532 Hardware Manual

   TDS2020PM      Hitachi's H8/500 Series Programming Manual

The second and third (without diagrams) are available via the Manual-on-Disk
included with this package. After installation select TDS2020 Manual-on-disk
from Program Manager

For a detailed description of available library programs see the publication
'Application Software for TDS2020 & TDS9092' available free on request.



                         TDS2020 FAST START GUIDE
                         

This guide replaces the sections 'TDS-PC files' and 'TDS-PC installation' on
page 8 of the TDS2020 Technical Manual. The software described there is TDS-PC
for DOS. See the printed manual, or Manual-on-disk here for a fast start guide
to TDS2020 or TDS9092 hardware.

HARDWARE

To make the TDS2020 work you must plug in the TDS2020DV development board. This
should have three ICs in it:

    The Forth ROM nearest the single row connector
    A 62256 type (or equivalent) 32K RAM in the central position
    A 62256 type (or equivalent) 32K RAM in the other socket

Pin 1 is marked for each device, each goes in with the notch facing the writing
on the board. Link W should be made, with link X open.

Now plug the TDS2020 and its TDS2020DV piggy-back into the wire-wrap sockets
provided in the TDS2020 Starter Pack.

The power supply connections are as follows. No negative supply for the RS232
serial link is needed, it is generated on the board. In particular make sure you
use pin a32 for power and c32 for ground, not the other end of the connector,
that will destroy the board. On the other hand reversal of the power supply will
not harm the TDS2020 since it has an on-board series diode. The pin numbers are
clearly marked.

   PIN NO         FUNCTION
   a32            +6V to +16V (A stabilised supply is preferred)
   c32            GND

The PC compatible is attached through Receive, Transmit and Ground lines which
are pins a25, c25 and c32 respectively. The serial port assumed is COM1 (but
this can be changed, see TDS-PC DEVELOPMENT SOFTWARE in the TDS2020 Technical
Manual). The serial connections are:

   PC CONNECTIONS (on a serial port)
   ---------------------------------
   TDS2020 Receive (a25):              PC pin 2 (25-pin)       pin 3 (9-pin)
   TDS2020 Transmit (c25):             PC pin 3 (25-pin)       pin 2 (9-pin)
   TDS2020 Ground (c32):               PC pin 7 (25-pin)       pin 5 (9-pin)

Connections for a dumb terminal are as for a 25-pin PC connector. This can be
useful once the program is finished and in PROM. You could access the system in
the field with a hand terminal for example.

Some dumb terminals need connections between other pins at the 25-pin connector
to enable operation, consult the terminal manual. It should be set in full-
duplex mode, with 8 data bits, 1 stop bit and no parity. Select a baud rate of
9600 on the terminal.

On some non-PC compatibles it may be necessary to reverse pins 2 and 3, or to
use a 'null modem' connecting link. When using a different computer for
input/output to the TDS2020 you must provide software in it to transfer each
key-stroke to the serial port, and to put each incoming character on the screen.

TDS-PC FILES

The file name convention is:

   Starts with $ = TDS2020 Fig-Forth versions (now obsolete)
   Starts with # = TDS2020 ANS Forth versions
   Starts with _ = TDS9092 8-bit Forth Computer

TDS-PC for Windows is supplied on two 1.44M 3.5" disks for IBM compatible
machines. TDS-PC for DOS is available on request.

The first action is to copy the master disks supplied. Use the copies for
subsequent work. Keep the originals safe.

The TDS-PC for Windows should have the following files:

 ON DISK 1
   SETUP.EXE            Use to install system on your hard disk
   #README.             Latest information on TDS2020
   ... plus a set of compressed files used to install the system

 ON DISK 2
   #TDSPC.ARC           Archived file of TDS2020 ANS Forth libraries
   ARC.EXE              File used to unarchive the above
   UNARC.BAT            Batch file used by the setup program

In addition if you purchased the TDS2020UP Update Service there should be on
disk 2:

   #TDSPCUP.ARC         TDS2020 ANS Forth preemptive multitasker software,
                        other extra library routines.

INSTALLATION OF TDS-PC FOR WINDOWS

    Close all running windows applications
    From the Program Manager select the File Menu then Run
    Place the disk in the A drive and type A:setup return
    A small Set Up window will transfer system files to update your
      computer if necessary
    A dialog box suggesting C:\TDSWIN as the default TDS-PC directory
      appears, alter if you want the software placed elsewhere.
    TDS-PC files are now transferred and a new program group created
      in Program Manager.

All TDS2020 users should print out files #UPDATES.TDS and #README. The former
contains updates to the Forth kernel on the TDS2020, and the latter
documentation, news and corrections.

If you need the PC support software on more than one machine do not set up on
one and then copy the files to the other. Install twice from a copy of the
master disks so that the TDS-PC.INI configuration file automatically created
on first use (in your WINDOWS subdirectory) will be appropriate for each
computer.

START-UP

For full details of use and customisation see the topic Configuration, but if
you are in a hurry double-click the TDS-PC for Windows icon. You are presented
with the Computer board selection window and need to select either TDS2020 ANS
Forth or TDS9092 Fig-Forth.

If the set up is successful there will be a short delay while the PC checks for
the presence of a TDS2020 or TDS9092. Date and time are also set from the PC
clock. The Interactive window at the bottom will clear and the TDS2020 or
TDS9092's start-up message will appear at the top of the window.Communication
with the Forth computer is now established. You can type Forth words and after
return they will be interactively executed.

PROBLEMS

If you don't see the banner coming from the TDS2020 or TDS9092 select the
Interactive window with the mouse (caption band at the top goes darker than
other windows) and then press return a few times. If you see the 'ok' prompt
type COLD return to re-initialise the remote computer.

If the TDS2020 or TDS9092 gives no reply and you see the NOT RESPONDING
message:

    You may have forgotten to switch on the TDS2020 or TDS9092
    Its power supply may be bad, check that the voltage used is +6 to
      +16V. Do not use a small battery.
    You may have a faulty cable or wrongly wired connectors.
    You may be connected to the wrong COM port on the PC. To change
      it see topic Options menu - interactive.

Correct the fault and first disconnect the TDS2020 or TDS9092 from both the
power supply and PC so that you can try a proper cold start again. Select the
Interactive window then Options, then TDS Computer to bring you back to where
you were. Select OK to try to again to connect to the remote computer.

If you get the message Serial Error see the topic Interactive window.

Some notebooks have problems with communications programs like TDS-PC for
Windows, they may turn off the serial port when not receiving or transmitting.
If you have this problem look into the hardware configuration options for the
machine.

Also try pressing the reset button on the TDS2020 or TDS9092. Another
possibility is that the TDS2020 is in its standby mode, by software or because
the STBY* pin is held low for some reason. If still unsuccessful there may be
a hardware problem.

There is comprehensive on-line help. Apart from the 'Manual' and 'Help' menu
items you can select any window or menu item (using the keyboard is often
best), then press key F1 to bring up the topic referring to the item of
interest.

To get personal help contact us as follows. If you leave a message we'll
almost always get back to you within 24 hours, usually it is very much faster:

   Telephone   +44-181-539-0285         3.00am - 5.00pm Eastern Time
                                        Midnight - 2.00pm Pacific Time
                                        08.00 - 22.00hrs GMT or BST
   Fax         +44-181-558-8110
   CompuServe  100065,75
   Email       triangle@compuserve.com

The + in the telephone number above is your local international access code.
For instance from USA dial 011-44-181-558-8110 to send us a faxed request for
help.

Before calling please look at the #README file which may have instructions
which are more up to date. Also read the updates to the Forth system in
#UPDATES.TDS. When you contact us please be sure to state:

    Which computer, TDS2020 or TDS9092 you are using
    Version number on the Forth ROM
    Version number of TDS-PC development software on your PC

REQUIREMENTS

TDS-PC for Windows runs on most IBM compatible PCs, the minimum recommended
hardware requirement is:
    Processor 386SX or above
    Speed 25MHz or above
    640 x 480 resolution screen or better
    640k bytes of memory or more
    One free serial port designated COM1 to COM4
This is the minimum specification, the software will run much better on a
faster machine with a 1024 x 768 display.

The operating system should be any of:
    PC-DOS or MS-DOS 3.30 or higher with Windows 3.1 or higher
    Windows95
    OS/2 version 3.0 or higher
    NT version 3.51 or higher

Source code for TDS-PC is supplied as an optional extra and comes with the
Update Service. If you wish to modify the software the Microsoft Visual Basic
for Windows 3.0 (professional edition) is required. This is not necessary if
you do not intend to make changes.To use an external editor you will need one
which accepts the file name on the same line as the command. For example this
might be  EDIT TASK.TDS  if you want to edit the file TASK.TDS . (All Forth
files created for the TDS2020 or TDS9092 computer are automatically given the
extension .TDS ). We can send a suitable shareware editor if you do not have
your own. If you choose to use an external word-processor the software needs
to be set in the  programming  or  plain ASCII  mode to avoid extraneous
embedded characters.


SOURCE CODE ANALYSIS AND DATABASE IN TDS-PC FOR WINDOWS

This feature produces reports on your source code. It gives you suggestions for
code improvements and produces a report on your TDS2020 or TDS9092 program which
can be used for project documentation. This includes a list of all Forth words
listed in alphanumeric order.

If a source code editing window is not highlighted, only the first menu option
shows because the source code from which the database is to be made is not
defined.

These commands work only if you have subscribed to the TDS2020UP Update Service
and have version 2.06 or above of TDS-PC for Windows.

VIEW DATABASE (ctrl/F1 key)

This will enable you to choose a database from those previously prepared with
the 'Make database' option. The screen displays a combined list of all words in
the application, including:

    the top level source code file
    all its INCLUDE files
    in the Forth ROM
    in files #ANS.TDS and #EXTEND.TDS

Click on a word in the left hand list to see its definition. Your definitions
are marked with a bar to the right of the word in the selection list. Any word
you defined but did not reference is marked with another symbol instead of a
bar. It may be a block, open box or thicker bar depending on the font selected.
These words are candidates for deletion from your source code.

In addition to the definition, the database window also shows the name of the
file containing the source code and the number of times the word is referenced
in your source code. For instance you may choose to move words with only one
reference to in-line code instead of as a separate definition.

The databases are read-only and quite separate from your source code. A database
is only updated when you choose the 'Make database' menu selection. Note that
you can highlight part of the displayed definitions or source code and copy the
text to the clipboard with ctrl/ins. It can subsequently be inserted in new
source code with shift/ins. This can save keying text you have used before.

All database files have the ending  '.MDB', for instance if the source file was
TRIAL.TDS the database file will be TRIAL.MDB.

A button marked 'File it' will produce a file with the extension '.TXT', for
example TRIAL.TXT with is a list of all definitions in alphanumeric order
followed by a report on the source file (see below). This file can be imported
into a normal wordprocessor to help produce documentation for the application.

The other button, marked 'Print', will directly print the alphanumeric listing
and source code report. This will be formatted so that as far as possible Forth
definitions do not continue from one page to the next.

The display also has a button marked 'Suggest' to toggle to a list of possible
improvements to your program, stored in a file with the extension '.SUG', eg:
TRIAL.SUG. There are not only suggestions for improvement in ROM space and
execution time, the screen is a complete report on your source program and its
include files. The report includes:

    Alphanumeric list of all words defined and used, including those in the
      Forth ROM and files #ANS.TDS or #EXTEND.TDS

    List of all files making up a set for your program

    Statistics on numbers of words defined and referenced

    List of words defined but never referenced, candidates for deletion

    List of words defined but referenced only once. You might choose to make
      some of these in-line code for speed and to save ROM code.

    Suggested improvements to your program

The 'Print' button on this screen will print the report on your source file
without the preceeding alphanumeric listing.

MAKE DATABASE

To make this option available, click on the source editor window (yellow by
default) which contains the top level file of your program.

It will produce a database and (optionally) produce a report which includes
suggestions for improving your program. TDS-PC for Windows will analyse your
program (taking into consideration all INCLUDE files) and make a database of
your source code procedures.  Any definition can then be instantly accessed
while you are editing other parts of your program.  In addition you can see a
report on your program, see above.

A database will be retained, even after you shut down the computer, until you
choose the 'Make Database' menu selection again for the same source file.


CORRECTIONS TO TDS2020 TECHNICAL MANUAL (August 1995 edition)

General   Change all references to current Forth version from 3.05 to 3.06

Page   8  The sections 'TDS-PC FILES' and 'TDS-PC INSTALLATION' describe
           TDS-PC for DOS. TDS-PC for Windows is also available, see above.
Page   9  Change line 5: Full installation needs 1353k bytes, minimum requires
           1198k bytes (with Update Service 2299k and 1609k respectively).

Page  30  Pin 67 of the TDS9 Gate Array should be connected to the pins
           labelled P0A15*.

Page  55  Add these substitutions:
             (Not Fig-Forth)        ANS Forth
             TDS2020 Version 2.13   TDS2020 Version 3.06
               BELL                   $07 EMIT
               BETWEEN                1+ WITHIN
               COMPILE                POSTPONE
               DOWN                   $0A EMIT
               HOME                   $0B EMIT
               ID.                    .ID
               LEFT                   $08 EMIT
               RIGHT                  $1C EMIT
               UP                     $1E EMIT
               [COMPILE]              POSTPONE (usually, but see #ANS.TDS)

Page  60  The stack conditions for both examples should read  ( n1 - n2 ) .

Page  60  Add another two items to the list of 'Points to Watch':
           DO  in Fig-Forth should normally be replaced by  ?DO  in the
             conversion to ANS Forth because, given two equal parameters, the
             ANS Forth version of  DO  will loop 65536 times, not 0 times as
             the Fig-Forth version.
           The structure  DO ... -1 +LOOP  will loop one more time in
             ANS Forth than in Fig-Forth. Search the Fig-Forth source code
             for all occurrences of  +LOOP  and make any adjustment necessary.

Page  78  In the fourth paragraph change '36ms' to '4.920ms (7.362ms when
           using the TDS2020DV development board)'.  

Page  83  The LM018 typical display shown is 40 char x 2 line, not as shown

Page  87  Change these lines to the versions shown:
           Write BIG text            <BIG  .( Hello! ) BIG>
           Write MEDium text         <MED  .( Hello! ) MED>
           Write TINY text           <TINY .( Hello! ) TINY>
           Add below the table: Change  .( Hello! )  to  ." Hello! "
            when you include it in a definition.

Page 103  At the end of the section  USE OF VARIABLES  add the following:
           The ANS Forth words  VALUE  and  TO  give better variables than use
           of  VARIABLE  @  ! .  They are more readable and both writing and
           reading the variable are half the speed. Examples:
                VARIABLE XYZ     is replaced by    0 VALUE XYZ
                XYZ @            is replaced by    XYZ
                XYZ !            is replaced by    TO XYZ
           See page 345 for more information.

Page 104  On line 13 insert  $FF80 $1C +ORIGIN !  before  $FDA2 VDP !
          On line 18 insert  $FF80 $1C +ORIGIN !  before  $FDF2 VDP !

Page 109  The maximum number of loops for a DO ... LOOP structure
           is 65536, not 32767.

Page 128  In  BCLRI,  change the example to  B $FF8E )) 2 ## BCLRI,
          In  BNOTI,  change the example to  B $FF8E )) 2 ## BNOTI,

Page 130  In  BSETI,  change the example to  B $FF8E )) 2 ## BSETI,
          In  BTSTI,  change the example to  B $FF8E )) 2 ## BTSTI,

Page 154  Add to the list at the bottom of the page:
           U.  U.R  .  D.R  .R  and any word dependent of these.

Page 171  The section 'TDS-PC DEVELOPMENT SOFTWARE' describes TDS-PC for DOS.
           TDS-PC for Windows is also available, see above.

Page 207  In the diagram the 74HC138 pin 8 should be marked as pin 7. Pin
           8 is the ground connection.

Page 213  An updated modem EUROCOM24 is now supplied. The +5V power should be
           connected to BOTH pins 14 and 15. Alternatively connect a single
           supply of 6 to 16V to pin 15. The modem is capable of 2400 baud as
           well as 1200 baud, the baud rate is selected automatically from the
           first incoming signal from the TDS2020.

Page 223  In the TDS961 diagram the +12V input pin should read a32 not a31,
           and the supply to the two inductors should read +12V not +5V.

Page 244  The card described, TDS2020CM, has been superseded by TDS2020CM2
           for new designs. There are many additional facilities, see
           the Data Logger Module data sheet and software support files for
           details.

Page 251  Table should read as follows:
             00000. to   7FFFF. Below 32-pin on-board chip           512k bytes
             80000. to   FFFFF. On-board 32-pin memory chip          512k bytes
            100000. to  4FFFFF. First  Card Memory, link 4 not made    4M bytes
            100000. to  AFFFFF. First  Card Memory, link 4 not made   10M bytes
            100000. to 14FFFFF. First  Card Memory, link 4 not made   20M bytes
           8100000. to 84FFFFF. Second Card Memory, link 4 made        4M bytes
           8100000. to 8AFFFFF. Second Card Memory, link 4 made       10M bytes
           8100000. to 94FFFFF. Second Card Memory, link 4 made       20M bytes

Page 294  In  <ACCEPT>  add: The value of n2 is the number of characters
           actually received, not including the cr.

Page 302  In  BCLRI,  change the example to  B $FF8E )) 2 ## BCLRI,

Page 303  In  BNOTI,  change the example to  B $FF8E )) 2 ## BNOTI,

Page 304  In  BSETI,  change the example to  B $FF8E )) 2 ## BSETI,
          In  BTSTI,  change the example to  B $FF8E )) 2 ## BTSTI,

Page 320  At the end of the definition of IFCASE (top of first column) add:
           Otherwise discard both values and continue execution in-line.

Page 321  Under LATER change the number 53000 to 65000.

Page 322  Under LCDEMIT change the example to read:
             : TEST (  --  ) \ Display time continuously
                <LCD  BEGIN 0AT .TIME KEY? UNTIL  LCD> ;
             For definitions of <LCD and LCD> see page 86.

Page 329  At the end of the definition of OF (top of first column) add:
           Otherwise discard both values and continue execution in-line.

Page 345  Under VALUE add:  In assembler you can access the address of a
          variable  XYZ  defined by  0 VALUE XYZ  like this:
             ' XYZ 2+ ))   R3   MOVI, \ reads content of variable to R3

