Author Topic: Tektronix 4924 Tape Drive Emulator  (Read 34780 times)

0 Members and 2 Guests are viewing this topic.

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #50 on: February 28, 2021, 02:53:21 pm »
Excellent!

I don't think long filenames are required for this application, Tektronix tape drives only had numbers from 1 to 99 for the file "names".

I also don't think we need ExFat - my entire collection of Tektronix programs (which also includes some manuals) is 350MB zipped, so maybe 1GB of BASIC text programs.

Instead of using a long filename to have the file header information as I previously thought, I can put all the file headers in each directory in a single file containing one 72 character string for each file header.

The tape file header is read by the Tektronix computer when the file is opened with a "FILE #" command, so the computer knows the data type(s) for that file.
The computer creates the original file header as a "NEW" file type. 

The first time that file is opened and written to by a program will then change the file header to match the program operation.
Examples:
  • A NEW file that is first written with a PRINT A$ command, will cause the computer to read-modify-write the file header to an ASCII DATA file type.
  • A NEW file that is opened and a SAVE command is executed will first have the file header modified to indicate ASCII PROGRAM file type.
  • A NEW file that is opened and a BSAVE command is executed will first have the file header modified by the computer to indicate BINARY PROGRAM file type.

All the burden for understanding the file type and rules on what data to expect on a READ command are on the computer, not the tape drive, since the tape drive could be used with different systems including terminals and some of the early scopes.

I expect the computer to read a byte at a time from the tape drive after using the FIND # command and decide when to stop the transaction.

The tape drive will indicate end of file if there is no data remaining in that file.

In order for the computer to read the file header, it sends a special PRINT command with secondary address 0 to the tape drive:

Code: [Select]
STATUS 0  (MTA 69)(MSA 96)(ReturnedStatus)(UNT)              Input command from 4050, return four status numeric variables

STATUS 0  (MLA 37)(MSA 96)(A,B,C,D)(UNL)                     Print command from 4050, receive four tape parameters
                                                                  ex: PRINT @5,0:0,0,1 disable Headers so they can be read with INPUT after FIND
                                                                  ex: PRINT @5,0:0,0,0 enable Headers for normal file operations
 
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #51 on: March 01, 2021, 01:51:50 am »
Maybe the SdFat 2.0 version has too much capability for this project.

I deleted the SdFat 2.0 library and downloaded the latest 1.0 library from the Releases list.

Then I ran SdFormatter in the 1.0 examples and reformatted my 32GB MicroSD card.

Then I ran SdInfo in the 1.0 examples and got this report:


Code: [Select]
SdFat version: 10102

Assuming the SD is the only SPI device.
Edit DISABLE_CHIP_SELECT to disable another device.

Assuming the SD chip select pin is: 10
Edit SD_CHIP_SELECT to change the SD chip select pin.

type any character to start

init time: 13 ms

Card type: SDHC

Manufacturer ID: 0X3
OEM ID: SD
Product: SC32G
Version: 8.0
Serial number: 0X2FF11AB0
Manufacturing date: 8/2013

cardSize: 31914.98 MB (MB = 1,000,000 bytes)
flashEraseSize: 128 blocks
eraseSingleBlock: true
OCR: 0XC0FF8000

SD Partition Table
part,boot,type,start,length
1,0X0,0XC,8192,62325760
2,0X0,0X0,0,0
3,0X0,0X0,0,0
4,0X0,0X0,0,0

Volume is FAT32
blocksPerCluster: 64
clusterCount: 973584
freeClusters: 973583
freeSpace: 31902.37 MB (MB = 1,000,000 bytes)
fatStartBlock: 9362
fatCount: 2
blocksPerFat: 7607
rootDirStart: 2
dataStartBlock: 24576

type any character to start

Here is the memory footprint from Arduino 1.8.13 for the SdInfo program:

Code: [Select]
Using library SdFat at version 1.1.4 in folder: C:\Users\mcgrawmc\Documents\Arduino\libraries\SdFat
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-size" -A "C:\\Users\\mcgrawmc\\AppData\\Local\\Temp\\arduino_build_246140/SdFormatter.ino.elf"
Sketch uses 12220 bytes (37%) of program storage space. Maximum is 32256 bytes.
Global variables use 803 bytes (39%) of dynamic memory, leaving 1245 bytes for local variables. Maximum is 2048 bytes.

I think this SdFat 1.0 version gives us more program space and memory space than the 2.0 version - and should be compatible API calls.
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #52 on: March 01, 2021, 02:05:52 am »
Not to mention I did this on my Pololu A-star 328PB Micro board with Micro SD adapter  ;D

" alt="" class="bbc_img" />

I moved the +5V power wire from the serial adapter end of the board to the ISP connector to eliminate the low-voltage regulator drop on the +5V.

I also cut the GND pin from top and bottom sides and wired it to Vcc for the CTS signal and added the orange wire from the USB-TTL adapter into the header.

Next step is to design a case for the assembly and 3D print it.
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #53 on: March 01, 2021, 02:09:21 am »
Actually I installed a 4.7K pullup resistor from Vcc to the CTS pin (just in case I try to plug a ground wire into the first position of the header.
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #54 on: March 04, 2021, 01:01:39 pm »
I copied four files with long filenames to the MicroSD card from my PC.

Then loaded/compiled/ran the Directory example in same SdFat version 1.0 as SdInfo above, same MicroSD SSD.

My four files with long filenames were copied to the root folder and showed up in each of the listings.

The Directory example created a folder and two files and showed the MicroSD contents including the created Folder1 as it created and deleted the two files and then Folder1 was deleted successfully:

Code: [Select]
Type any character to start


Please use an empty SD for best results.

Created Folder1
Created Folder1/file1.txt
chdir to Folder1
Created File2.txt in current directory

List of files on the SD.
Folder1/
  file1.txt
  File2.txt
a-star-328pb-micro-schematic.pdf
My Tektronix GPIB breadboard in June 2018.jpg
My Pololu 328PB with MicroSD card.jpg
IMG-2366.jpg

file1.txt and File2.txt removed.

List of files on the SD.
Folder1/
a-star-328pb-micro-schematic.pdf
My Tektronix GPIB breadboard in June 2018.jpg
My Pololu 328PB with MicroSD card.jpg
IMG-2366.jpg

Folder1 removed.

List of files on the SD.
a-star-328pb-micro-schematic.pdf
My Tektronix GPIB breadboard in June 2018.jpg
My Pololu 328PB with MicroSD card.jpg
IMG-2366.jpg
Done!


I think SdFat version 10102 is a keeper  ;D
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #55 on: March 04, 2021, 01:05:17 pm »
and here is the memory footprint on the Pololu A-Star 328PB Micro for the Directory Functions example:

Code: [Select]
Sketch uses 15278 bytes (47%) of program storage space. Maximum is 32256 bytes.
Global variables use 1065 bytes (52%) of dynamic memory, leaving 983 bytes for local variables. Maximum is 2048 bytes.

 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #56 on: March 10, 2021, 06:32:27 pm »
I have begun prototyping my 4924 tape emulator on the 328PB Micro with the Tektronix 4050 BASIC "TLIST" command, which lists the files on a tape in numeric order.

Here is the output of my TLIST command - including extra text indicating the detected file type (ASCII or HEX):

Code: [Select]
TLIST of files in TEST directory

 1      ASCII   PROG [LIST-F.FD]   30     FileType = ASCII
 2      ASCII   DATA [Advitm   ]   10     FileType = ASCII
 3      BINARY  DATA               29     FileType = HEX
 4      ASCII   PROGRAM   SECRET   26     FileType = HEX
 5      ASCII   PROG [DUPL ASCI]   18     FileType = ASCII
 6      ASCII   PROG [4924 dupe]   33     FileType = ASCII
 7      ASCII   PROG [Bubl Sort]   30     FileType = ASCII
 8      ASCII   PROG [TapeHeadr]   11     FileType = ASCII
 9      ASCII   PROG [AlphaSort]   14     FileType = ASCII
 10     ASCII   PROG [QuickSort]   12     FileType = ASCII
 11     ASCII   PROG [TLIST EXT]   15     FileType = ASCII
 12     LAST                      3     FileType = ASCII

Tektronix 4050 tape files have several attributes:
  • File number - used to access the file
  • File data type - ASCII or BINARY
  • File type - PROGRAM or DATA
  • SECRET - this attribute indicates the PROGRAM is encrypted
  • File size - this column indicates how many 256 byte blocks were allocated for this file when it was MARKed

You will notice that some of the files show additional information like a filename.
Tektronix published information in the 4050 Programmers Reference Guide on how to access this file header and modify the header with additional information.

However, there were several constraints on these modifications as shown in the fragment of the manual below:



My code so far does not have the GPIB device mode code, I only have the SdFat v2 library for Micro SD card file input/output and my test program.
The sketch currently uses 12808 byte of program storage (39%) and 1014 bytes of RAM (49%).

If the 328PB Arduino does not have enough room for the full program, I have a Pandauino Atmega 644 board coming that has 64KB of flash and 4KB of RAM:


 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #57 on: March 13, 2021, 01:30:55 am »
Another update on my Tek 4924 emulator functions.

I have TLIST and FIND functions coded, with the ability to run the FIND command with the required file number parameter.

I have also created some test files using shortened versions of Tektronix utility programs that had tape headers modified to add names of the programs.

The Tek 4050 BASIC programs tend to make heavy use of ASCII control characters in PRINT statements:
- CR is only allowed as the delimiter for every line
- LF is used inside PRINT statements to get to a newline without requiring a new PRINT statement
- HT provides a TAB function
- FF clears the storage tube screen
- and a couple of others

Since Arduino uses LF for a newline, I took advantage of the ArduinoOutStream to use CR as a line delimiter instead of LF for example.

Since the Arduino serial monitor appears to drop the CRs, I use RealTerm which has a font displaying control characters and supports CR with a true carriage return after printing the CR control character.

Here is a RealTerm screen showing opening and printing one of my BASIC test program files.

Notice only a CR at the end of each line, and LFs inside PRINT statements:

1192516-0

I also received the Atmega 644 Narrow board from Mouser, added the hardware support for this board to the Arduino IDE and compiled the same program from the 328PB board.
You can see in the IDE compiler output that the 644 Narrow board has 64KB of flash and 4KB of RAM - double the flash and RAM compared to the 328PB.

1192520-1

If we don't have enough RAM for the final emulator program in the 328PB - I plan to have the 644 Narrow board mounted to the AR488 board with a MicroSD adapter as my backup plan.
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #58 on: March 13, 2021, 01:34:19 am »
Wow, that second attachment was unreadable.  I didn't notice that I didn't crop the width.

Hope this is readable this time:

1192556-0
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #59 on: March 14, 2021, 03:29:56 am »
Even more progress!

On the hardware side, I have my Pandauino 644-Narrow connected to the AR488 PCB from artag, and have added an Adafruit MicroSD adapter.

The assembly works with EZ-GPIB, even though the 644-Narrow uses the CH340G USB to TTL serial IC, I didn't have to ground the pins 9 and 10 as indicated in another eevblog thread.  In fact, grounding those pins caused EZ-GPIB to fail to detect the board :(  Realterm indicated both CTS and DSR to be asserted.  What I did have to do was add a 100 ohm pullup resistor on the ATmega644 reset input, which prevents EZ-GPIB from resetting the ATmega644 during serial discovery.  I did have to run EZ-GPIB twice to get it to detect the 644-Narrow running AR488 code with my custom pinout, and I was able to duplicate my results of interfacing to the Agilent 34970A data acquisition instrument.

Then I added the Adafruit MicroSD adapter and was able to read the MicroSD card that I had used in the Pololu 328PB.

I wanted to integrate my MicroSD reader code into the AR488, and added three new 'Prologix' commands:
Code: [Select]
++tlist    This command emulates the 4924 tape drive listing all the files on a tape
++find #   This command will find the file number # and the full SD card filename will be saved for the next command
++old      This command loads the current file number into Tek 4050 as a BASIC program

Here is a screenshot of running the full program.   I modified the AR488 version string for use with the EZ-GPIB software.



Here is the Arduino memory utilization of the program so far - tragically, I won't fit in the 328PB, but that is why I got the Pandauino 644-Narrow  ;D



It looks like I'll have plenty of room for the rest of my Tektronix 4924 GPIB tape drive emulator code
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #60 on: March 14, 2021, 03:48:34 am »
Here are photos of my board stack with artag's AR488 GPIB connector board and my Pandauino 644-Narrow ATmega644 with an Adafruit MicroSD adapter:





The 644-Narrow is 0.1" wider than the 328PB, but I pushed the header pins to make it fit.
I also pushed four pins on one side 0.1" closer to avoid the 3.3V signal in the middle.

I only have two jumper wires - a +5V power to the MicroSD as I must have damaged the PCB trying to remove that pin to mount it on top of the board, and pin 4 as the MicroSD chip select.
And one 100 ohm resistor from the reset switch to a header pin next to a +5V pin that I can add a jumper so EZ-GPIB identifies this board as a Prologix board without triggering reset.  I remove the jumper to upload new Arduino code to the board.

Here is my AR488 custom pin layout for the 644-Narrow board:

Code: [Select]
/*******************************/
/***** AR488 CUSTOM LAYOUT *****/
/***** vvvvvvvvvvvvvvvvvvv *****/
#ifdef AR488_CUSTOM

// AR488_CUSTOM defs for Pandauino 644-Narrow
#define DIO1  11   /* GPIB 1  */
#define DIO2  24   /* GPIB 2  */
#define DIO3  26   /* GPIB 3  */
#define DIO4  25   /* GPIB 4  */
#define DIO5  16   /* GPIB 13 */
#define DIO6  17   /* GPIB 14 */
#define DIO7  27   /* GPIB 15 */
#define DIO8  14   /* GPIB 16 */

#define IFC   12   /* GPIB 9  */
#define NDAC  3    /* GPIB 8  */
#define NRFD  2    /* GPIB 7  */
#define DAV   1    /* GPIB 6  */
#define EOI   0    /* GPIB 5  */

#define SRQ   15    /* GPIB 10 */
#define REN   13    /* GPIB 17 */
#define ATN   10   /* GPIB 11 */

#endif
/***** ^^^^^^^^^^^^^^^^^^^ *****/
/***** AR488 CUSTOM LAYOUT *****/
/*******************************/
 

Offline WaveyDipoleTopic starter

  • Frequent Contributor
  • **
  • Posts: 851
  • Country: gb
Re: Tektronix 4924 Tape Drive Emulator
« Reply #61 on: April 02, 2021, 08:50:14 am »
I see you are making great progress with the project. I am sorry I have not been able to contribute much for the last few weeks. I am currently caring for my 81-year old mum who has been in and out of hospital for the last 3 weeks and time has been very limited.

However, I see you have given up on the 328p and decided to use another board for the project. I must admit that my motivation waned somewhat when I discovered that the memory on the 328p was just too small. I had not come across the Panduino before, but its similarly small footprint seems handy to fit the Artag adapter board. Interesting to note that it works nicely with EZ-GPIB and you now have a couple of commands working. At some point you will need to send GPIB data to the memory card instead of the serial port, which was the next problem I started to grapple with but didn't quite get around to.

I am not sure how long the current situation will last or how much time I can contribute to the project in the current circumstances although I will keep an eye on developments.
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #62 on: April 02, 2021, 12:50:58 pm »
Take care of your mum - family comes first!

I did design my first PCB and sent it to Oshpark this week.

1207562-0

1207566-1

The PCB will mount the 644-Narrow directly and use the ISP header connections to power the MicroSD adapter without the rework I did on my prototype.
I organized the GPIB data pins to route them to the same ATmega 644 port.

Next, I'll try to modify the nifty 3D printable case posted on the AR488 thread to fit my stack of boards.
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #63 on: April 09, 2021, 02:01:17 pm »
I received my PCB order from Oshpark yesterday and assembled one of the boards - it worked with EZ-GPIB to access my Agilent 34970A Data Acquisition Unit!



Here is the Tape Emulator plugged into the Agilent for testing with EZ-GPIB:



The assembly is only about 0.1" taller and 0.1" wider than artag's AR488 design with a Pro Micro.

The 644-Narrow board with the ATmega644 processor is quite a bit longer than the Pro Micro, so there are no mounting holes for the GPIB connector, but I plan to modify the 3D case design posted recently in the AR488 thread, which mechanically supports both the GPIB connector and the stack of boards without using the GPIB mounting holes.

Here is the new custom layout for my Tape Emulator PCB:

Code: [Select]
/*******************************/
/***** AR488 CUSTOM LAYOUT *****/
/***** vvvvvvvvvvvvvvvvvvv *****/
#ifdef AR488_CUSTOM

// AR488_CUSTOM defs for Pandauino 644-Narrow in Monty's Tektronix 4924 Tape Emulator PCB connector
#define DIO1  10   /* GPIB 1  */
#define DIO2  11   /* GPIB 2  */
#define DIO3  12   /* GPIB 3  */
#define DIO4  13   /* GPIB 4  */
#define DIO5  14   /* GPIB 13 */
#define DIO6  15   /* GPIB 14 */
#define DIO7  16   /* GPIB 15 */
#define DIO8  17   /* GPIB 16 */

#define IFC   22   /* GPIB 9  */
#define NDAC  21   /* GPIB 8  */
#define NRFD  20   /* GPIB 7  */
#define DAV   19   /* GPIB 6  */
#define EOI   18   /* GPIB 5  */

#define SRQ   23   /* GPIB 10 */
#define REN   24   /* GPIB 17 */
#define ATN   31   /* GPIB 11 */

#endif
/***** ^^^^^^^^^^^^^^^^^^^ *****/
/***** AR488 CUSTOM LAYOUT *****/
/*******************************/
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #64 on: April 09, 2021, 02:04:52 pm »
I don't know why my photos didn't show up.



 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #65 on: April 09, 2021, 02:12:46 pm »
The 2-pin jumper in the photo connects the 100 ohm resistor from the RESET pin on the reset switch to +5V, and is only used to prevent the board reset when running EZ-GPIB.

I still have to run EZ-GPIB twice to have it identify the board as a Prologix GPIB adapter, and then it successfully runs my quick test program to acquire three voltage samples from the Agilent.

The jumper must be removed to upload a program from the Arduino IDE, and will be removed when running my Tape Emulator connected to a Tektronix computer.
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #66 on: May 26, 2021, 05:19:39 pm »
Do you have a GitHub account?

I have created a private repository for the code I have so far here:

https://github.com/Twilight-Logic/AR488_Store.git

I can give your account so that you can access edit files and push updates.

WaveyDipole,

That link used to work, but I now get a 404 error trying to access it.
 

Offline WaveyDipoleTopic starter

  • Frequent Contributor
  • **
  • Posts: 851
  • Country: gb
Re: Tektronix 4924 Tape Drive Emulator
« Reply #67 on: June 03, 2021, 06:43:12 pm »
It is still there as a private repository and I haven't changed anything.
The link is still:

https://github.com/Twilight-Logic/AR488_Store.git

I am not sure whay you can't access it?
Maybe a GitHub glitch. I can remove you and send you another invite? Just a bit worried that may loose access altogether but its the only thing I can think of right now.
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #68 on: June 03, 2021, 10:20:42 pm »
It is still there as a private repository and I haven't changed anything.
The link is still:

https://github.com/Twilight-Logic/AR488_Store.git

I am not sure whay you can't access it?
Maybe a GitHub glitch. I can remove you and send you another invite? Just a bit worried that may loose access altogether but its the only thing I can think of right now.

Sorry, I posted that I had fixed it on the AR488 forum.

I had replaced my laptop, so I had not been authenticating to github.  Soon as I logged into github, I could access the AR488_Store files.

Right now, I'm cleaning up the pieces of Emulator code I had running on the AR488 and will migrate it to AR488_Store so I can send my changes to you.  You should be able to run the code with a Mega2560.

Here is a snapshot of running several of my Emulator commands on my 644_Narrow board with my GPIB adapter:

" alt="" class="bbc_img" />
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #69 on: June 03, 2021, 10:31:55 pm »
My new Tektronix 4924 Tape Emulator PCB eliminates all my jumper wires when I was plugging into an artag AR488 Pro Micro GPIB adapter PCB.

Here is the top view of the new assembly and a side view:

1224695-0" alt="" class="bbc_img" />

« Last Edit: June 04, 2021, 12:08:32 pm by mmcgraw74 »
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #70 on: June 03, 2021, 10:33:46 pm »
still having trouble figuring out how to post images here :(

Here is the top view of my new Tektronix 4924 Emulator assembly:

1224697-0" alt="" class="bbc_img" />
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #71 on: June 03, 2021, 10:40:48 pm »
TLIST is a Tek 4050 BASIC command to list all the files on a tape with their Header information.
FIND is a command to locate and open a file on the tape.
OLD is a command to load an ASCII PROGRAM that has been opened

The read1 command is not a BASIC command, but my test of the INPUT A$ command on an ASCII file that has been opened to read a single string (data or program statement).

The cd command is one I intend to add to the menu program allowing multiple "tapes" to be stored in separate MicroSD card directories.
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #72 on: June 05, 2021, 03:34:19 pm »
@WaveyDipole,

I created a Monty1 branch on AR488_Store.

I had lots of errors trying to compile your original files - I put the compile errors.txt file output from my Arduino 1.8.13 IDE in my branch AR488_Store folder.
I also tried to move my files into AR488_Store and had similar compile errors.  I put this effort in my branch AR488_Store-TLIST...etc folder.
I uploaded my working code into my branch AR488-644-TLIST... etc folder

I also uploaded the zip of all the Tektronix 4924 test files on my microSD card, and uploaded a Tek4924sd folder with the files unzipped.

You should be able to compile and run my AR488-644-TLIST... version (which sends output to serial and does not use GPIB yet) using a Mega2560 with a level-shifter microSD adapter (Adafruit or Pololu) attached to SPI pins, CS pin,+5V and ground.

I use Realterm as the serial console - since it shows all the control characters, and Tek BASIC barfs on linefeed characters that are not inside text in a PRINT statement.
My current code changes the line termination on output to CR.

I am using a Sandisk Ultra 32GB microSD card, formatted as FAT32.

My code assumes all files are in separate directories on the microSD card, with the /root/ directory being the default directory.
There will not be subdirectories in any of the directories.
Each directory will contain up to 99 files which is the limit of file numbers in Tek 4050 BASIC.
I am taking advantage of SdFat long filename support and putting the contents of the tape file header into the FAT32 filename, and I am not using the file extension.

This is a list of the filenames in the /utilities/ directory.

My code extracts the emulated tape file number from the first number in the filename.
File type is based on extracting other characters from the file 'headers': ASCII or BINARY and PROG or DATA
Detection of SECRET programs is based on finding an "S" in that position in the header - see file number 4.
Programs that added comments to the file header had to avoid putting an "S" at that location - or the file would be unusable.
File size is the last number (number of blocks) * 256 bytes per block

Code: [Select]
[font=courier]
 1      ASCII   PROG [LIST-F.FD]   30
 10     ASCII   PROG [QuickSort]   12
 11     ASCII   PROG [TLIST EXT]   15
 12     LAST                      3
 2      ASCII   DATA [Advitm   ]   10
 3      BINARY  DATA               29
 4      ASCII   PROGRAM   SECRET   26
 5      ASCII   DATA [492Scope ]   18
 6      BINARY  DATA [4924 dupe]   33
 7      ASCII   PROG [Bubl Sort]   30
 8      ASCII   PROG [TapeHeadr]   11
 9      ASCII   PROG [AlphaSort]   14
[/font]

« Last Edit: June 05, 2021, 03:40:24 pm by mmcgraw74 »
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #73 on: June 07, 2021, 12:44:10 pm »
@WaveyDipole,

I have updated my latest dev build of the emulator on my Monty1 branch of AR488_Store.

I need help porting this build into your AR488_Store program - I can't build your program so I have continued my development changes in your original AR488 program.

Here is a screenshot of my latest dev build, I have added functions to read1 allowing an ASCII or BINARY file to be read one record at a time:

1226047-0
 

Offline WaveyDipoleTopic starter

  • Frequent Contributor
  • **
  • Posts: 851
  • Country: gb
Re: Tektronix 4924 Tape Drive Emulator
« Reply #74 on: June 07, 2021, 11:32:17 pm »
Thanks for all your work. I will have a look at earliest opportunity.

UPDATE: Had a look this morning but am a bit puzzled. Had a look in the 'AR488-644-TLIST-continuedDev' directory but couldn't see the 'AR488_Store_Tek' files. The point behind keeping the storage hardware routines in their own separate file was to be able to e.g. add 'AR488_Store_Pet' and other possible storage devices in the future and be able to select between them. I see that the Tek code has been moved to the main .ino file. I am happy to run with that for now if it helps with progressing development.

I was still on version 1.8.12 and have now upgraded to the latest version which is 1.8.15. In the meantime I also downloaded version 1.8.13 to test with. There were a few warnings, but no errors and the code did compile. The IDE reports that there is insufficient memory on the Uno and Polulu boards so I selected the Mega2560 board.

Here are a few observations about the warnings:

The warnings on line 547 and 612 (comparison between signed and unsigned integer expressions) arise because 'nMax' is defined as a const uint16_t while 'number' is is a type int. For consistency variables being compared need to be of the same type, either type 'int' or type 'uint16_t'.

Either change 'nMax' to 'const int' or 'number' and 'index' (an maybe also 'filenumber') to type 'uint16_t'. That should get rid of that particular warning.

Warnings about unused variables can usually be ignored. Either they will get used eventually when the code is complete, of they can be removed once it has been established that they are no longer required. The warning should then go away.

Line 2119, 2131, 2139 and 2147 :

e.g.
void help_h(char *params)
void readf_h(char *params)
void read1_h(char *params)
void old_h(char *params)
void tlist_h(char *params)

Since 'params' is not actually being used, and assuming it is not going to be used, can be defined as:

void help_h()
void readf_h()
void read1_h()
void old_h()
void tlist_h()

Their references in cmdHidx will need to be cast to type 'void' by changing them to:

    { "readf",       3, (void(*)(char*)) readf_h     }
    { "read1",       3, (void(*)(char*)) read1_h     }
    { "help",        3, (void(*)(char*)) help_h      }
    { "old",         3, (void(*)(char*)) old_h       }
    { "tlist",         3, (void(*)(char*)) tlist_h       }

That will get rid of those warnings.

Line 2178: warning: statement has no effect
    f_name[0];        //clear previous f_name prior to tlist

I presume the intention was to clear 'char f_name[46]' of all characters?  In C++ you do this with:

  memset(f_name, '\0', 46)

That fills the memory assigned to the array will null bytes.

Hope this helps a little.
« Last Edit: June 08, 2021, 08:07:02 am by WaveyDipole »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf