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

0 Members and 1 Guest are viewing this topic.

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 176
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #25 on: January 30, 2021, 12:11:20 am »
I just found a Nano V3 board with the ATmega328PB CPU and ordered it.

From reading several internet posts - I may have to fiddle with the bootloader, but I expect I can get it to work with the Arduino IDE, and it should have the new E0 and E1 digital / analog ports on A6 and A7.
 

Offline WaveyDipole

  • Frequent Contributor
  • **
  • Posts: 642
  • Country: gb
Re: Tektronix 4924 Tape Drive Emulator
« Reply #26 on: January 30, 2021, 09:14:05 pm »
That 328PB chip is interesting. If it has the capability to use A6 and A7 as digital pins then that might be useful. I couldn't find a Nano on eBay with a 328PB. Where did you find it? I did wonder whether one might be able to replace the chip, but by the time you add the cost of the chip and a Nano board you have reached the cost of a Pololu board so it is probably not worth the effort. I have also found the MCP23S17 chip which can expand the number of GPIO ports by 16 using the SPI interface so there is another way of adding GPIO pins to a Uno/Nano/32u4 or other small Arduino board.

Regarding the serial port, the external TTL board still connects to the Rx/Tx pins on the processor. If those pins get used as GPIO pins, then it *might* still be possible to program the board using the reset button. As you have noted, this is, by all accounts, a bit of a fiddle as one has to get the timing right, but I have never tried that so cannot say whether it works or not. The Pololu board does have the six pin ICSP/SPI header which is where the AVR programmer will plug in. It does not use the Tx/Rx pins so that approach would free up those two pins and programming would be no problem.

Incidentally, I have run into problems with the SD card reader again. It wouldn't initialise the card. I removed it and put it into the laptop and it couldn't mount the filesystem. I formatted the card in Windows with FAT32 but the Ardiono card reader still will not initialise it. I have ordered another reader and am waiting for it to arrive.
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 176
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #27 on: January 30, 2021, 09:58:35 pm »
Here is where I ordered the Nano board with the 328PB for $7.63 (since apparently the 328PB is a lot less expensive than the 328P):
https://www.importedelectronics.com/products/arduino-nano-v3-0-pins-soldered-atmega328p-5v-ch340g-1-mini-usb-cable?_pos=3&_sid=5691ae0a5&_ss=r

According to the Pololu pinout diagram - all 24 of the 328PB IO pins are digital capable and provide interrupt capability, plus there are up to two USART, SPI, and i2C interfaces:



Of course the Pololu A-Star Micro 328PB pins are in a different order than the Nano - and the Nano only provides 22 of the IO pins (no PE0 or PE1).

Note the A6 and A7 pins are also definable as part of a SPI1 interface in addition to being digital pins with interrupt capability.
« Last Edit: January 30, 2021, 10:43:59 pm by mmcgraw74 »
 

Offline WaveyDipole

  • Frequent Contributor
  • **
  • Posts: 642
  • Country: gb
Re: Tektronix 4924 Tape Drive Emulator
« Reply #28 on: February 03, 2021, 02:01:19 pm »
I do hope you get a 328PB on there. The photo shows a 328P....

Unfortunately I can't find a seller in the UK so might have to buy a Pololu board. Unless I can find a UK supplier, this will come from the EU so there will be at least 20% tax plus any import charge. The Mega2560 Pro Mini is slightly cheaper (from China) than the Pololu so may be a better option for me here in the UK.

My SD card reader has arrived and seems to be working OK so I can resume work on the project.
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 176
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #29 on: February 03, 2021, 02:43:04 pm »
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 176
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #30 on: February 05, 2021, 02:07:07 am »
I received my Pololu A-Star 328PB Micro today, added the A-Star link in Pololu doc to the Arduino IDE and managed to get the board programmed with the Blink example - but I didn't order the Pololu recommended USB-TTL adapter, I got a different brand, but it didn't have the extra DTR or RTS pin to reset the board, so I kept pressing the reset button on the board and did get it programmed with the Blink code, and I doubled the blink rate to make sure it was working.  I've ordered a different USB-TTL adapter with the correct pins to reset the Arduino for programming.

I think I will order one of artag's Arduino Micro to GPIB boards and connect the A-Star Micro to that board first.

I also received the Pololu microSD adapter which has 5V to 3.3V level shifters to connect to the A-Star Micro extra pins.
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 176
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #31 on: February 05, 2021, 06:55:14 pm »
Waveydipole,

I think the A-Star 328PB Micro is a good fit for the GPIB Tape Drive emulator.

Here is my diagram for using the Pololu A-Star 328PB Micro with Artag's GPIB PCB plus a Pololu MicroSD adapter with level-shifter:



I've got PCBs and GPIB connectors ordered - should get them by mid-February.

Do you see any issues with using the different Arduino pins for this?

I plan to put a header on the top end of the A-Star to connect to a USB-TTL adapter for programming, and then to connect to +5V and GND power on the Tektronix from a ROM Pack, which is near the GPIB connector on the rear of the Tektronix 405x computers for usage.
 

Offline WaveyDipole

  • Frequent Contributor
  • **
  • Posts: 642
  • Country: gb
Re: Tektronix 4924 Tape Drive Emulator
« Reply #32 on: February 10, 2021, 09:44:38 am »
If I may a couple of observations? The MicroSD adapter board makes use of SCK0 on the central 6-way connector, but SCK0 is also presented on PB13 which is used for DIO7 (GPIB pin 15). I also expect it will be necessary to cut the track to PD1 in order to be able to use it as a GND otherwise that would interfere with TXD0. The same will be required for PB5 and one possibility is to link across to the unused PE3 or maybe PE1 which is nearer. It might be easier to re-work Artag's adapter board which I can probably have a go at if I can find Atrag's original design files to use as a starting point. Having said all of that, I think there are, at least, possibilities.
« Last Edit: February 10, 2021, 10:55:01 am by WaveyDipole »
 

Offline WaveyDipole

  • Frequent Contributor
  • **
  • Posts: 642
  • Country: gb
Re: Tektronix 4924 Tape Drive Emulator
« Reply #33 on: February 12, 2021, 02:44:29 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.
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 176
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #34 on: February 12, 2021, 03:08:30 pm »
yes, my account is mmcgraw74
 

Offline WaveyDipole

  • Frequent Contributor
  • **
  • Posts: 642
  • Country: gb
Re: Tektronix 4924 Tape Drive Emulator
« Reply #35 on: February 12, 2021, 03:55:16 pm »
I have sent you an invitation as a collaborator.

The code is still a long way from a workable program. It has been re-structured extensively and everything, including all GPIB functions, will need to be tested at some point. You will see the storage code in module AR488_Store_Tek_4924.h and AR488_Store_Tek_4924.cpp. I have created an outline that provides a couple of storage management functions and allows a GPIB secondary address to be passed as a command to a handle function, but the individual handler functions are yet to be written. I moved the GPIB functions to AR488_GPIB.h and AR488_GPIB.cpp so that the code can be shared between modules.

At this point the code compiles with no errors but with a handful of warnings, one of which relates to the included SD library which I'm not sure I can fix. The program is as yet untested.

Two functions I have added to the GPIB library are:

void gpibSendFromFile(File sdfile);
bool gpibWriteToFile(File sdfile);

It should be possible to call them directly from AR488_Store_Tek_4924.cpp.

Many of the controller specific functions have been removed, however, as mentioned previously, the SD library is "huge" by microcontroller standards so I'm not sure how well this will work on a 328P or 328PB at this point.
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 176
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #36 on: February 17, 2021, 06:08:33 pm »
If I may a couple of observations? The MicroSD adapter board makes use of SCK0 on the central 6-way connector, but SCK0 is also presented on PB13 which is used for DIO7 (GPIB pin 15). I also expect it will be necessary to cut the track to PD1 in order to be able to use it as a GND otherwise that would interfere with TXD0. The same will be required for PB5 and one possibility is to link across to the unused PE3 or maybe PE1 which is nearer. It might be easier to re-work Artag's adapter board which I can probably have a go at if I can find Atrag's original design files to use as a starting point. Having said all of that, I think there are, at least, possibilities.

Good catch on pin 13 PB5 conflict as it is SCK0.

I updated my diagram to connect PE1 with a jumper wire to the AR488 PCB pin D10.
I also put NC next to the A-Star 328PB Micro pins that won't be connected to the AR488 PCB, including the A-Star PDO,PD1,PE3,PB5 and PE0 pins.

[attachimg=1]

There would only be three jumper wires - two grounds and PE1 to the AR488 D10 pin, so I think that is fine for testing.

My OSHPARK PCB order does not show shipment yet, so in the meantime, I plan to wire the microSD card to the 328PB Micro, and see how much free space is left after uploading your current Arduino code.
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 176
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #37 on: February 17, 2021, 11:06:44 pm »
I don't know how fast the Arduino 328P can transfer GPIB data, but I'll bet it is faster than the Tektronix computers.

Here is a table of the older 4051 computer GPIB performance on various BASIC commands.  The 4051 used PIAs and a little control logic for GPIB.

[attachimg=2]


The 4052 and 4054 had about 10x BASIC performance advantage over the 4051 with custom 16-bit bit-slice microcoded architecture emulating the Motorola 6800 opcodes and adding hardware floating point.  I didn't find any documentation on their GPIB performance but it could have been faster.

The last generation was the 4052A and 4054A with the same bit-slice CPU performance as the 4052/4054 but added the TI 9914 GPIB integrated circuit.
The 4052A GPIB Guide had this table of GPIB performance:

[attachimg=1]


« Last Edit: February 17, 2021, 11:10:12 pm by mmcgraw74 »
 

Offline WaveyDipole

  • Frequent Contributor
  • **
  • Posts: 642
  • Country: gb
Re: Tektronix 4924 Tape Drive Emulator
« Reply #38 on: February 19, 2021, 06:59:59 pm »
Good catch on pin 13 PB5 conflict as it is SCK0.

I updated my diagram to connect PE1 with a jumper wire to the AR488 PCB pin D10.
I also put NC next to the A-Star 328PB Micro pins that won't be connected to the AR488 PCB, including the A-Star PDO,PD1,PE3,PB5 and PE0 pins.
With pins having multiple functions one has to be careful. Hopefully your amendments will work OK.


My OSHPARK PCB order does not show shipment yet, so in the meantime, I plan to wire the microSD card to the 328PB Micro, and see how much free space is left after uploading your current Arduino code.

That I fear may be an issue:

Quote
Sketch uses 27334 bytes (84%) of program storage space. Maximum is 32256 bytes.
Global variables use 1752 bytes (85%) of dynamic memory, leaving 296 bytes for local variables. Maximum is 2048 bytes.
Low memory available, stability problems may occur.

We will have to see how it goes.

I have been looking at some of the files and information on your GitHub. Thinking ahead.
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 176
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #39 on: February 19, 2021, 11:10:13 pm »
Quote
Sketch uses 27334 bytes (84%) of program storage space. Maximum is 32256 bytes.
Global variables use 1752 bytes (85%) of dynamic memory, leaving 296 bytes for local variables. Maximum is 2048 bytes.
Low memory available, stability problems may occur.

Quote
We will have to see how it goes.

I have been looking at some of the files and information on your GitHub. Thinking ahead.

My Nano program used the SDfat library - I believe it is smaller than the SD library.
 

Offline WaveyDipole

  • Frequent Contributor
  • **
  • Posts: 642
  • Country: gb
Re: Tektronix 4924 Tape Drive Emulator
« Reply #40 on: February 22, 2021, 06:33:03 pm »
I will investigate the SdFat library.

UPDATE: Had a quick look this morning. Just compiling the basic "Cardinfo" example for the SD library and the similar "SdInfo" example for the SdFat library, yields the following on a Uno:

SD library:
Quote
Sketch uses 10952 bytes (33%) of program storage space. Maximum is 32256 bytes.
Global variables use 1422 bytes (69%) of dynamic memory, leaving 626 bytes for local variables. Maximum is 2048 bytes.

SdFat library:
Quote
Sketch uses 13996 bytes (43%) of program storage space. Maximum is 32256 bytes.
Global variables use 901 bytes (43%) of dynamic memory, leaving 1147 bytes for local variables. Maximum is 2048 bytes.

The Pololu A-Star has the same amout of memory so not surprisingly the results are identical.

That's a 26% difference!

It looks like it will be worth the effort to re-write using the SdFat library. I will get to work on it ASAP.
« Last Edit: February 23, 2021, 11:50:31 am by WaveyDipole »
 

Offline WaveyDipole

  • Frequent Contributor
  • **
  • Posts: 642
  • Country: gb
Re: Tektronix 4924 Tape Drive Emulator
« Reply #41 on: February 27, 2021, 08:32:38 am »
Have maybe 90% done the conversion to the SdFat library but have ran into a bigger problem. Although this library uses lass dynamic memory and is a bit more flexible to work with, it seems to require much more program memory. Although it represents only 2% more memory on a Mega 2560, I am now up to 120% of program memory used on a 328P(B)!

Above I quoted the usage statistics of the "SdInfo" example. If one looks at the QuickStart example which is not much bigger, the usage stats on a UNO are:

Quote
Sketch uses 22938 bytes (71%) of program storage space. Maximum is 32256 bytes.
Global variables use 1060 bytes (51%) of dynamic memory, leaving 988 bytes for local variables. Maximum is 2048 bytes.

That's 71% of program memory used for just 200 lines of code! I could do some more digging to find out why, but that's a relatively huge usage for a small demo program.
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 176
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #42 on: February 27, 2021, 02:12:14 pm »
I have almost completed my assembly of the Pololu 328PB Micro on Artag's AR488 Pro Micro v3 board.

I would think I should test just the 328PB with the current AR488 GPIB code using a custom pin layout before assembling the SD card reader to the board.

Then assemble the SD Card reader and retest with your new code using SdFat?

I think the larger code footprint may be ok as the SdFat library has the hard part of the code, the actual tape APIs should make heavy use of the library and your GPIB code.
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 176
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #43 on: February 28, 2021, 12:06:17 am »
Yippee!!  ;D

My Pololu Microstar 328PB Micro has successfully passed GPIB tests with standard AR488 version 0.48.28 with my 328PB Micro Custom Layout and hardware serial!

In addition - I am using EZGPIB program!!

Here is a photo of my Pololu 328PB Micro soldered to artag's AR488 v3 board.

[attachimg=1]

Here is a list of how the 328PB Micro pinout is connected to the AR488 v3 board:

[attachimg=2]

My changes to the AR488 Config.h file were to add the custom layout from the pinout list:

Code: [Select]
// AR488_CUSTOM defs for Pololu Microstar 328PB Micro
#define DIO1  3    /* GPIB 1  */
#define DIO2  A2   /* GPIB 2  */
#define DIO3  A0   /* GPIB 3  */
#define DIO4  A1   /* GPIB 4  */
#define DIO5  8    /* GPIB 13 */
#define DIO6  9    /* GPIB 14 */
#define DIO7  SCL1 /* GPIB 15 */
#define DIO8  6    /* GPIB 16 */

#define IFC   4    /* GPIB 9  */
#define NDAC  A6   /* GPIB 8  */
#define NRFD  A5   /* GPIB 7  */
#define DAV   A4   /* GPIB 6  */
#define EOI   A3   /* GPIB 5  */

#define SRQ   7    /* GPIB 10 */
#define REN   5    /* GPIB 17 */
#define ATN   2    /* GPIB 11 */


And I changed the version string in the Config.h to:

Code: [Select]
#define FWVER "Prologix GPIB-USB Controller version 5.1"
//, AR488 ver. 0.48.28, Custom Pololu 328PB Micro layout 02/27/2021"

I also patched the EZGPIB.exe per posts in the AR488 thread.

Since the 328PB Micro does not have a USB to serial interface - I have connected the TTL serial pins on the "top" edge to a DSD=Tech SH-U08F USB to TTL adapter from Amazon: https://www.amazon.com/gp/product/B07BBPX8B8

This adapter uses an FTDI IC that has RTS/CTS which can be changed to other handshake signals inside the box.

I have the RTS connected to the Reset pin of the 328PB so that Arduino upload can reset the CPU.

I also connected the CTS of the TTL adapter to +5V on the 328PB to allow the EZGPIB.exe program to discover the 328PB - which reported "Prologix GPIB-USB Controller v5.1", exactly like a Prologix GPIB-USB Controller in my next picture reported.

I was have issues just using the AR488 with the serial console so I downloaded the EZ-GPIB.exe and patched it and then it detected my 328PB as shown in the EZGPIB debug console:

[attachimg=3]

Here is my AR488 328PB connected to the HP 34970A:

[attachimg=4]

I learned some HP 34970A commands and created a short program on EZ-GPIB with the Prologix GPIB-USB v2 adapter first, the was able to run the same program with my 328PB!

[attachimg=5]

And here is the front of the HP 34970A monitoring channel 101 which is directly connected to the 9V battery:

[attachimg=6]
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 176
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #44 on: February 28, 2021, 12:15:48 am »
I still can't figure out how to get inline pictures in my posts.

but the EZGPIB screenshot was a duplicate.

Here is the EZGPIB debug console showing my board was detected as a Prologix GPIB-USB:

[attachimg=1]

My next step will be attaching the Pololu MicroSD adapter with level shifters - it should look like this:

[attachimg=2]
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 176
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #45 on: February 28, 2021, 12:49:48 am »
My previous post had a link to the USB-TTL adapter I used.  The back of this adapter photo shows the part number as DSD Tech SH-U09C, not the part number in my previous post.

[attach=1]
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 176
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #46 on: February 28, 2021, 12:53:08 am »
I am using the USB to TTL adapter RTS signal to reset my Pololu 328PB as that signal is supported by the AVRDUDE software.
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 176
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #47 on: February 28, 2021, 12:56:58 am »
One more update - you can see in my photo of plugging the 328PB into the HP 34970A GPIB connector - I have unplugged the RTS signal from the USB-TTL converter, as EZ-GPIB asserts the RTS, which resets the 328PB and results in not detecting the 328PB.

To update the Arduino program on the 328PB - I plug the RTS back into the USB-TTL converter.
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 176
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #48 on: February 28, 2021, 01:04:36 am »
I thought I posted my photo of the 9V battery being voltage monitored by the HP 34970A.

Here is that photo:

[attachimg=1]
 

Offline WaveyDipole

  • Frequent Contributor
  • **
  • Posts: 642
  • Country: gb
Re: Tektronix 4924 Tape Drive Emulator
« Reply #49 on: February 28, 2021, 01:49:32 pm »
It looks like you are making really good progress on the hardware side of things!

I also have made some progress on the software side. I logged an issue about the memory usage on the SdFat authors GitHub page and he came back with some suggestions. I have tried these out this has reduced the memory requirement:

Quote
Sketch uses 26706 bytes (82%) of program storage space. Maximum is 32256 bytes.
Global variables use 1588 bytes (77%) of dynamic memory, leaving 460 bytes for local variables. Maximum is 2048 bytes.
Low memory available, stability problems may occur.

This is an improvement but comes at the cost of long filenames and disabling ExFAT. Apparently the standard Arduino SD library supports only FAT16/32. The modification basically disables ExFAT and long filenames. I am hoping that the latter can be worked around. I am almost at the point where I was before I changed the library. I need to do some more work to tidy up the code and finish the final two functions, then we will have a proper basis of comparison.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf