UPDATING DSP-10X FLASH

updated batch files to check PC BIOS June 20 2013
added more error descriptions July 3 2013

 IMPORTANT NOTE!

A DSPx with an Atmel AT49BV512 Flash chip will not work with these routines. The Atmel device has only a single 64K Bank. The 39VF040 is looked for, and if not found, the procedure is terminated. This causes no harm, other than frustration.

The instructions for this operation are in the batch file. The motivation for writing this is to provide a well documented step by step procedure to update the monitor, or to copy a monitor from one chip to another, without a programmer.  SHORT OVERVIEW

Right click, save as .. whatever gets it done ...

V1.ZIP  All the files in a ZIP file (updated on July 3 2013)

Here is a self executing file that will make a bootable floppy containing all the files needed to update the DSP-10 FLASH memory in BANK0.

Bootable 1.44 floppy(updated on July 3 2013)
This is a self installing bootable image file. You can run it to a floppy in a local drive, without saving the image. Click on the link above and a window will open asking to run or save

You may save this as a file, but if you have a floppy drive on your internet machine,
put a floppy in the drive now, and select "run".
Another window will open and tell you to put a floppy in the A; drive.

Select "Create Floppy" and another window will open warning that the disk contents will be overwritten.

and  finally there is a last window advising the process is complete.


You may use this floppy to boot into DOS, and all the files needed to do FLASH BANK0 and BANK1 are on the disk.

Just the batch files
HOT.BAT  (updated on July 3 2013)
MON.BAT (updated on July 3 2013)

and the terminal program  CK6.EXE (updated on July 3 2013)

These files must all be in the same directory, on a machine running DOS and connected to a running DSP-10x by an RS232 serial cable.

This will be satisfied if you boot from this floppy.

All batch programs can be TERMINATED by Control-C whenever there is a prompt that says "Strike a key when ready .  .  ."
The prompt varies by operating system,. Could be "Hit any key to continue", and possibly more.
   

You will need access to the reset button in the DSP enclosure or be able to cycle the power off/on when directed
to hit the reset button.

Turning the power off, and back on, has the same result as hitting the reset button. 

You will also need to have access to the Jumpers on the 2185 board.


MON.BAT
    Use this batch file to load an updated MONITOR program into Flash Bank 0.
    Type MON at the DOS prompt, then <enter>
    Follow the prompts on the screen.
    (XMON295.HEX checksum is 563F)

HOT.BAT
    You will need a 39VF040 with a monitor in BANK 0, as well as a target 39VF040.
    This batch file is very similar to MON.BAT, but has instructions that lead you
    through writing a monitor to a chip that has no monitor in FLASH BANK0.
    Type HOT at the DOS prompt, then <enter>
    This is done with power on, with caution.
 

CK6.EXE
    this terminal program can be used along with UHF3X.BAT to read checksum
    of either bank    1 or 2 after FLASHUTB is running in DSP memory.  To load
    FLASHUTB into DSP memory Start UHF3X and follow the prompts until  you
     see these three lines:

    The Flash utility is running and will write the contents
    of UHF3XHA.HEX to Bank1 you may enter Control C, ^C to quit now or
    Strike a key when ready .  .  .

    Hold the control key (ctrl) while pressing C. The response will be:

    Halt batch process (Y/N) ?_

    Press Y

    You will be at the DOS prompt, and may now run CK6.EXE by entering :
    CK6  n <enter>      n is the COM number, 1 2 3 or 4
    When the terminal screen is displayed, type C (capital C)
    followed by either 01 or 00, for BANK1 or BANK0.
   
    To quit the terminal program    Hit the Escape key

VERSIONS of DOS tested, that work

MSDOS 6.22
DR DOS 7.02
MSDOS 7.0 Windows 95  (Version 4.00.950)  Win95
MSDOS 7.10 Windows 98 Version 4.10.1998   Win 98 ME
MSDOS 7.10a Windows 98 Version 4.10.2222  Win 98 SE
MSDOS 8.0 Windows Millenium Version 4.90.3000  Win ME & Win XP Home
 

VERSIONS of WINDOWS tested

None of which work

W95
W98FE
W98SE
XP home

Any one tried DOSBOX in LINUX ? or DOSEMU ?


The ADSP2185 is a specailized processor optimized to handle FFT calculations, but also does many other jobs to make the DSP-10 operate. It does nothing on its own and requires instructions to be loaded into its memory. Flash  memory is used to store the programs that the ADSP2185 uses.

When the DSP-10 is started the ADSP2185 looks for something to run.  In the case of the ADSP2185 used in the DSP-10x, this is BANK0 of the 39VF040 flash memory. The first few instructions are a "boot loader" that load the monitor from the flash to the low memory of the ADSP-2185 and start the monitor running.  Once running, the monitor looks at the jumpers, JP1 and JP2 on the interface board to see what should happen next. 

The monitor checks  JP1 for further instruction and if JP1  is closed,  looks in BANK1 and loads the UHF3 DSP program into the ADSP2185 and turns execution over to the DSP program.

If JP1 is open, the monitor waits for instructions from the outside. This is where the monitor is used to load FLASHUTB to the ADSP2185 and execution is turned over to the "FLASH UTILITY".

The flash utility knows how to talk to the flash memory, and we use it to load new insructions and/or programs to the appropriate flash memory bank. The monitor is still in the ADSP2185 memory, but program execution is under control of the "FLASH UTILITY" , FLASHUTB.EXE. 

As long as power is on, the ADSP2185 memory is retained, and we can use this feature to write a copy of the monitor back to the FLASH MEMORY. If you erase or corrupt the monitor in BANK0, it can be written back by the flash utility from the copy in ADSP2185 memory. If you erase or corrupt the monitor in BANK0, AND reset the DSP-10 or cycle the power, then there is no longer a copy of the monitor in the ADSP2185, and you can put this away until you get another 39VF040 flash chip with a monitor in BANK0.

The monitor is the first thing we use and the heart of these operations, and without it there is no reading, or writing of the flash memory. 

The batch file is an attempt to simplify the operation of getting new software loaded to flash memory using routines written by KK7P and updated by W7PUA. The batch file provides an interface that protects from mistakes. The routines have a great deal of checking built in and have been tested extensively. It is possible to screw this up, but you will have to work at it pretty hard.


Batch file description

 more or less in order of execution.
 
While this is aimed at a specific version of UHF3 or monitor program, there is a provision to use any filename.
 
The first thing that happens is deleting a file named P1.TXT in case it exists. This will be used in a later step to check the PC BIOS.
 
The current directory is checked for all files that may be needed and exits on the first occurrence of a missing file.
 
AD1, a small DOS program is called to look in the PC BIOS for serial port entries, if entries are found then ADI returns control to the batch file. If no entries are found, it writes an empty file, named P1.TXT, in the current directory.
 
If the user has started the program with an option, then fn is set to hold the option value (the file name) otherwise fn is set to the default. If the user typed a name other than the default, the file name is checked to see if it exists in the current directory. If not found the program exits.
 
Now we are down to "testports". The variable, el, is set to an absurd value and the existence of  P1.TXT is looked for, and if found we exit because there are no serial ports.

The "testports" section includes XFINDMN1 and may be used multiple times to branch according to what is, or is not found.
If FLASHUTB, the flash utility, is found running we  skip to running EZLD, if something else is found running, then the user is lead through jumper settings to make the jumpers correct and we loop back to "testports" and XFINDMN1 is called again. IF nothing is found running (el=0) we generate an error and exit.  I don't know how it might happen, but in case el is never changed, and is still 99 after dropping through the testports section, the program is exited. If XFINDMN1 does not find any programs running, this is reported and the program exits.
 
Each subsection of the testports section leads to a specific action to get the correct program running in the DSP. The goal is to load FLASHUTB. If UHF3 is found running the user is directed to remove the jumper on JP1, and reset the DSP, and away it goes again. Next time through it should find a monitor running, in which case we can use EZLD to get FLASHUTB loaded. If FLASHUTB is the first thing found running, as might happen if the user has done resets or something,  XFLASH1 is executed. Previously the BIOS was checked, and XFINDMN1 has run which is also doing error checking, so there should be no conditions that prevent EZLD from loading the flash utility. Time out "should not" happen. When EZLD finishes FLASHUTB should be running and the execution loops through testports again, and if FLASHUTB is found running, it branches to "doload" and the XFLASH1 runs. There is still the possibility that we could get to the bottom of the testports section, so there is a GOTO END to prevent an endless loop.
 
If the user got this right, at the get go, and no errors are encountered, very little intervention is needed. If errors are encountered, they are reported and execution either halts, or the user is directed to change jumpers and reset as appropriate. 
 
 
    set fn=
    set el=
    KILL P1.TXT
    echo off
    CLS
    echo Rev 2 Bank 1 Loader
    echo This is for updating DSP10x DSP programs
    echo.
    echo To specify a different UHF3X program to load,
    echo Type UHF3X UHF3Xxxx.HEX or whatever the filename is....
    echo You may quit by holding the Control key and C,
    echo to start over,     otherwise hit any key to load UHF3X35A.HEX
    echo.
    echo Control C to start over
    echo              OR
    echo Strike a key when ready
    echo.
    echo.
    echo.
    pause > nul
    echo.
    echo checking files
    echo.
    IF NOT EXIST AD1.EXE echo File AD1.EXE not found.
    IF NOT EXIST AD1.EXE GOTO splash
    IF NOT EXIST EZLD.COM echo File EZLD.COM not found.
    IF NOT EXIST EZLD.COM GOTO splash
    IF NOT EXIST FLASHUTB.EXE echo File FLASHUTB.EXE not found.
    IF NOT EXIST FLASHUTB.EXE GOTO splash
    IF NOT EXIST XFINDMN1.EXE echo File XFINDMN1.EXE not found.
    IF NOT EXIST XFINDMN1.EXE GOTO splash
    IF NOT EXIST XFLASH1.EXE echo File XFLASH1.EXE not found.
    IF NOT EXIST XFLASH1.EXE GOTO splash
    IF NOT EXIST UHF3X35A.HEX echo File UHF3X35A.HEX not found.
    IF NOT EXIST UHF3X35A.HEX GOTO splash
    rem call ad1 to check PC BIOS
    AD1
    rem if option exists goto ..
    if not "%1"=="" GOTO rename
    rem otherwise fall through and
    set fn=UHF3XHA.HEX
    rem and skip checking file name
    GOTO testports
:rename
    rem  make file name = option 1
    set fn=%1
    rem  if misspelled or not exist go to trap
    IF NOT EXIST %fn% GOTO bsp
    rem  if all OK fall through
   
:testports
    set el=99
    CLS
   
    echo Checking ports and DSPx
    echo.
    IF EXIST P1.TXT    GOTO noport
    XFINDMN1
   
     rem  Returns a value to ERRORLEVEL
     rem      0    No DSPx program found
     rem      1+p  Program on COM1
     rem      2+p  Program on COM2
     rem      3+p  Program on COM3
     rem      4+p  Program on COM4
     rem      where p=0 for Monitor program
     rem            p=4 for FLASHUTx program
     rem            p=8 for DSP-10 UHF3 program
   
    echo off
   
    rem  UHF3 running
    IF ERRORLEVEL 12 SET el=4
    IF %el%==4 GOTO  doreset
    IF ERRORLEVEL 11 SET el=3
    IF %el%==3 GOTO  doreset
    IF ERRORLEVEL 10 SET el=2
    IF %el%==2 GOTO  doreset
    IF ERRORLEVEL 9 SET el=1
    IF %el%==1 GOTO  doreset
   
    rem flash util running
    IF ERRORLEVEL 8 SET el=4
    IF %el%==4 GOTO doload
    IF ERRORLEVEL 7 SET el=3
    IF %el%==3 GOTO doload
    IF ERRORLEVEL 6 SET el=2
    IF %el%==2 GOTO doload
    IF ERRORLEVEL 5 SET el=1
    IF %el%==1 GOTO doload
   
    rem  monitor running
    IF ERRORLEVEL 4 SET el=4
    IF %el%==4 GOTO runezld
    IF ERRORLEVEL 3 SET el=3
    IF %el%==3 GOTO runezld
    IF ERRORLEVEL 2 SET el=2
    IF %el%==2 GOTO runezld
    IF ERRORLEVEL 1 SET el=1
    IF %el%==1 GOTO runezld

 
    IF ERRORLEVEL 0 SET el=0
    IF %el%==0 GOTO noserial
    IF %el%==99 GOTO bummer
    echo EXITING BATCH FILE
    GOTO end
 
:doreset
    echo.
    echo UHF3 is running in DSP memory
    echo Check that JUMPER JP1 is OPEN
    pause
    echo.
    echo Hit reset in the DSPx/KDSP interface NOW
    pause
    CLS
    GOTO testports
   
:runezld
    echo Wait while EZLD installs flash utility to DSP memory
    echo.
    echo on
    ezld %el% flashutb.exe g
    echo off
    GOTO testports
   
:doload
    echo.
    echo The Flash utility is running and will write the contents
    echo of %fn% to Bank1. Leave power on, and DO NOT hit the
    echo reset until directed.
    echo.
 
    set ec=5
    echo on
    xflash1 %el% 1 %fn% 0
    echo off
    echo EXITING BATCH FILE
    goto end
:bummer
    echo Something strange happened
    echo EXITING BATCH FILE
    GOTO end
 
:noport
    echo The PC BIOS is not set for any COM Ports.
    echo This is not a cable, power or DSP problem
    echo This must be fixed in the computer
    echo before anything can be run.
    echo EXITING BATCH FILE
    GOTO end
:noserial
    echo No serial communications were found with the DSP-10
    echo this can be caused by the DSP-10 being off, or the
    echo serial cable not connected. Sadly, it is also possible
    echo that there is no MONITOR in the FLASH. You can use a
    echo terminal program to check for the prescence of a monitor.
    echo EXITING BATCH FILE
    GOTO end
:bsp
    echo.
    echo.
    echo The file name  %fn%  entered as an option does not exist in the
    echo directory. Check your spelling and if the file exists in the
    echo directory.  If you know the path to the file, the path plus file
    echo can be used on the command line.
    echo.
     echo MON flash/work/NEWhex.HEX as an example
    echo EXITING BATCH FILE
    GOTO end
:splash
    echo.
    echo.
     echo.
    echo AD1.EXE, EZLD.COM, UHF3x.BAT, XFLASH1.EXE, XFINDMN1.EXE and UHF3X35A.HEX
    echo MUST BE in the same directory.
    echo.
    echo EXITING BATCH FILE
:end

DEFINT A-Z
DEF SEG = 0
CLS

source of  AD1.EXE

    LOCATE 1, 1
    J = PEEK(&H400)
    IF J = 0 THEN PRINT "   NO COM1" ELSE PRINT "COM1 AVAILABLE"

    K = PEEK(&H402)
    IF K = 0 THEN PRINT "   NO COM2" ELSE PRINT "COM2 AVAILABLE"

    L = PEEK(&H404)
    IF L = 0 THEN PRINT "   NO COM3" ELSE PRINT "COM3 AVAILABLE"
 
    M = PEEK(&H406)
    IF M = 0 THEN PRINT "   NO COM4" ELSE PRINT "COM4 AVAILABLE"
   
    IF J + K + L + M = 0 THEN OPEN "P1.TXT" FOR OUTPUT AS #6: CLOSE #6

AD1.EXE is not guaranteed to work with all BIOS or PCs.  It will detect if the IR ports are assigned on COM1 or 2 for some machines. It is possible that there is some combination that cannot be detected properly.  Older Compaq machines come to mind...

KD7TS HOME