Sunday, December 1, 2024

Rotation, sector and index pulse timings good, as is reading a sector; working on capturing a write to a sector now

COMPLICATIONS THAT HAD TO BE VERIFIED

The design can operate in one of two modes - virtual only or hybrid where it operates in conjunction with a spinning, operating disk drive. The logic varies in quite a few places depending on whether we are completely driven by incoming sector and index pulses from the disk drive or whether we are generating them. 

I wanted to check that even with jitter and speed variations, the hybrid mode would correctly produce the pulses and more importantly be in complete sync with the sector that is under the read/write heads. We have to pick up the proper sector's content to feed it to the 1130 during a read; for a write, we must be updating the proper sector's image in DRAM. 

The pulses could arrive in any relationship to the logic in the FPGA, which I tested by shifting the pulses generated in my test bench. It is easier for virtual mode, since the FPGA is producing the sector and index pulses itself. 

I very carefully checked all the emitted signals from the modules producing sector and index information. When this was as tested as I could achieve without real hardware, I moved on to test the process of reading a sector on disk. For this, the 1130 controller logic looks at the sector address, then raises the read gate signal when the appropriate sector pulse finishes in the targeted sector number. 

My testbench produced the stream of clock and data pulses that the 1130 controller logic expects from the disk drive. This is approximately 250 microseconds of alternating pulses, which are a 1 for the clock and an absence of a pulse to represent a bit of 0. The 250 us of zero bits allows the disk drive to sync up and learn  to separate data and clock bits, since they are simply sequential pulses or absence of pulses on the disk surface. 

At the end of the 250 us, a word is written with only the high order bit set - x1000 - which the controller logic uses to know when a new word is starting. This sync word is followed by a stream of pulses which represent up to 321 words of 16 data bits plus 4 check bits, delineated by the controller based on the sync word identifying where a new word begins. 

When the read logic was accurately generating the pulses in the proper timing, I could verify that the pulses delivered on the data and clock lines from the disk drive are correct. One aspect of my read logic is that it has to generate the four check bits for each word. Thus, after sixteen bits of data for a word is emitted, the next four bits are the check pattern that implements IBM's error checking algorithm.

The ECC is pretty simple - during the reading of each word, a two bit counter is advanced for every data bit that is a 1 value. The counter rolls over, so that after it saw three 1 bits, another 1 bit sets it to zero. Thus the counter is operating modulo four. After the sixteenth data bit, check bits are produced to bring the counter to zero. 

This means if we had 1, 5, 9, or 13 bits with a 1 value, the counter is at 1 and we generate a check pattern of 1110 which advances the counter so it reaches 0 at the end of the word. If we had 2, 6, 10 or 14 bits with a 1 value, the counter was at 2 and the check bit pattern of 1100 advances it back to 0. Having 3, 7, 11, or 14 bits with a 1 value gives a counter of 3 and the check bit pattern 1000 gets it back to 0. Words with 0, 4, 8 or 12 bits with a 1 value ends with a counter that is already 0, so the check bit pattern is 0000 since we don't have to advance the counter. 

For every 1130 data word - 16 bits - we write 20 bits onto disk in order to have the four check bits appended. The file containing the disk cartridge contents only saves the 16 bits per word, with our read logic generating check bits on the fly. If the controller logic doesn't end the 20 bit word with a counter value other than 0, it has detected a read error and flags the read as defective. 

I verified that this read logic worked in both hybrid and virtual modes. It appeared very solid, but needs testing on real hardware to be certain I have it correctly generating the bits. 

WRITE LOGIC INVOLVES A MIXED STREAM OF CLOCK AND DATA BITS

When the controller logic is writing to a sector, it is varying a single signal line. Whenever that signal is at logic low, a flux reversal is produced on the disk surface; if the signal is logic high, no flux reversal is produced, thus no pulse is on the disk. Timing is how you differentiate clock and data pulses, since they are a single stream on disk. 

The disk drive produces a 720 KHz oscillator signal that is fed to the disk controller logic in the 1130. When that signal is at logic low, we are writing the clock pulse which is always present. Thus, the combined signal line to the disk drive is low when the oscillator signal is low. When the oscillator signal is high, this is the time where we write a pulse for a data bit value of 1 or we do nothing to signify the data value is 0. 

My testbench had to produce the combined signal line that would come from the 1130 logic. It is fed by an oscillator we are generating in our write module. In hybrid mode, I plan to feed the actual 720KHz signal produced by the disk drive but in virtual mode, we generate the oscillator. 

I know the logic gates involved in toggling the combined signal line so I could reproduce their impact pretty faithfully. Bit counter E is on when we are in the check bits, thus this writes a pulse if check bits haven't set the counter to 0 yet. When bit counter E is off, we are writing the sixteen data bits of the word, emitting a pulse if the current bit value is 1. Finally, if -Write Clock Phase B (our oscillator signal) is low, we always produce a pulse for the clock. 

What happens in the real world is that there are delays in the oscillator signal from the disk to the controller, plus delays going through the logic gates, so the combined signal is not edge coincident with the oscillator coming from the disk or my write logic. This had to be simulated to be certain that my write logic would capture the intended data words coming from the 1130 to write onto the disk sector. 

In write mode, I have to follow the 250 us of zero bit values (clock pulse followed by no pulse), then detect the sync word so I could separate the clock from the data bits on the combined line. As well, I had to know when a new word began, just as the controller logic must determine when it is reading. 

When the oscillator signal is high, I open up a timing window but don't look too close to the signal edges. This protects me from the delays I mentioned two paragraphs above. During the window I open in the middle of the logic high portion of the oscillator, I look for a low value on the combined signal line. If I see one, I have captured a value of 1 for that data bit. 

The one and zero bit values are shifted into a register as they coming in from the 1130 controller logic. I keep the two bit counter based on bits with a value of 1. When the sixteenth bit was received, I capture the next four bits only to advance the two bit counter. At the end of the 20th bit, if the counter is not 0 then I have detected an ECC error. The register only had the first 16 bits shifted in, then it was written to the DRAM and the address advanced to the next word in the sector. 

I continue to grab words and store them sequentially in DRAM as the write from the 1130 continues. If we reach the next sector pulse while trying to write, an error is detected and reflected to the program requesting the disk write. As long as I am accurately producing the sector pulses as I capture bits from a read, my logic will work correctly with the disk controller. 

The test bench code to produce the combined signal line properly based on the oscillator signal value is complicated. Not only emitting the sync word so the controller logic is in sync with us, but skipping the check bits and properly delineating the completion of each 1130 data word. On top of that, I had to introduce some delays just to understand what that does to my write logic. 

I am not done yet with testing of the write logic. The test bench code is almost complete to my satisfaction, and I have adjusted some of the write logic already based on that simulation stream. I am going to take my time with this one as it is likely the most challenging part of the logic to get right. 

Friday, November 29, 2024

Believe the Virtual 2315 Cartridge Facility FPGA design is done, undertaking thorough simulations now

FPGA DESIGN RUNS IN GEORGE WILEY'S RK-05 EMULATOR BOX

The emulator was modified from providing virtual RK-05 disk drives into the facility that provides either a virtual or a hybrid 2310 (IBM 1130 internal) disk drive. Hybrid means the drive in the 1130 is spinning with a cartridge inserted, but the emulator is managing the flow of data to and from the 1130. Arm movements occur on the physical drive and are mirrored inside the emulator. 

The disk heads are not flying on the inserted cartridge, whose actual contents are ignored. Rather, an image on a micro SD card in the emulator is fed to the 1130 during disk reads and any writes from the 1130 are captured to update the image inside the emulator. 

COMPLETED LOGIC FOR THE FPGA DEVICE INSIDE THE EMULATOR

My design modified the Verilog built by George, adapting it to the way the 2310 disk drive works and introducing the hybrid mode. I believe it has implemented what I intended, but I need to very carefully simulate it as a first check that this is true. Once that is done I can begin testing on the IBM 1130 until it works as intended, compatibly and accurately. 

SIMULATIONS BEING RUN UNDER VIVADO TOOLCHAIN

I am using AMD's Vivado (originally from Xilinx) to simulate the various functions of my code. I intend to build this up function by function except for the two areas that are just too complex to model well in a simulation - operation of the SDRAM in the emulator box and the dialog over an SPI communications link from an application running in a Raspberry Pi Pico (also inside the emulator box). 

Sunday, November 24, 2024

Drat - error in my new PCB for 1627 controller card

STOPPED DEBUGGING THE BODGED CARD ON THE BENCH

Mostly the card was working correctly but I would continue to get flakey behavior that after investigation seems to be issues with the bench testing apparatus itself. The only issue that was still occurring was quite odd. 

When the system reset (DC Reset) would stop, the request for interrupt on level 3 (IL3) would immediately go on, but this was not because of any of the six movement commands being activated. If I monitored the DSW Bit 14 (busy) signal using a pullup resistor, the false triggering of the IL3 stopped! 

There is no logical connection between these other than possible shorts or power interactions through chips. It doesn't make sense from the design thus I had to ascribe it to an issue with the particular card I am testing - the bodged up one with jumper wires to the donor SLT card. 

BUILT NEW SLT CARD WITH INTEGRATED SLT CONNECTOR

I soldered all the components onto the new version of the card which has an integrated connector, avoiding the requirement for donor cards or jumpers. All the spring contacts are in place on the card so that it can connect to the pins in an SLT card socket, either on my bench tester or more importantly in an IBM 1130 card compartment. 


It was time to install the housings on the end of the cards. I have not completed the new 3D printed housings, but I pulled two off of the donor SLT card I had been using for the earlier instance of the plotter controller card. 

DISCOVERED BAD SPACING BETWEEN THE TWO CONNECTORS

One housing fit but the other will interfere with the first if I try to install it. I compared it to the spacing of a normal double width card and saw that my layout for the PCB was wrong!



You can see in the picture above that the left row of contacts lines up with the openings in the housing but the right row of contacts is over too far to the left. The width of the space between the connectors is too small in my card. I measured the spacing on an IBM double wide card and found that the middle of the contacts on either side should be .375" apart. 



In addition, there are small tabs on the IBM SLT card that lock the housings onto the card, so I should be implementing them as well. 




Back to the drawing board (well, back to KiCAD) and another round of PCB manufacturing. 

Various parts for recreation cards

3D MODEL FOR COVER ON MY REPLACEMENT SLT CARDS

Eric Schlaepfer sent me his files for a cover that he used when he created substitute SLT cards. He removed the spring clips from junk cards, rather than buy new ones like I did, but otherwise it is the same process to build a PCB that will have an SLT connector on its end. I will make one to assess it for possible changes - since my spring contacts are wider than the IBM part, it may be necessary to alter the design. 


You may recognize Eric from his work creating the Monster 6502, from his Tube Time social media presence on X or from his work with Curious Marc on various projects. 

SMS POWER PADDLE CARD IN PCB FABRICATION

I designed a card to use with the SMS power connections that the IBM 1130 utilizes to provide power to the 1053 Console Printer, 1627 Plotter, 1134 Paper Tape Reader, internal disk drive, and 1054 Paper Tape Punch. These have a tendency to snap. This card will allow museums and other 1130 owners to replace the connectors that are damaged. I produced ten of them, but will also share the design files on Github for those who need to make their own. 



Saturday, November 23, 2024

Disk drive reconnection and one issue

WIRED UP THE AC POWER CABLE TO THE DISK DRIVE

The AC power cable was reinstalled in the disk drive, with the ground wire connected to the AC box lug and the hot and neutral wires connected to their spot on terminal block TB4 inside the box. The cable runs back to an SMS power card that is plugged into the SMS power connectors that are used for the 1053 console printer, disk drive, 1134 paper tape reader, 1055 paper tape punch and 1627 plotter devices. 

HOOKED UP THE RUN SWITCH AND DISK UNLOCKED LAMP WIRING

When I tested the wires to determine which switch terminals each connected, I discovered that the switch was not working properly. It is a DPDT switch although only the Normally Open and Pole terminals are used. One of the two poles was not connecting to either the NO or the Normally Closed contacts.

I used Deoxit to spray inside the switch and exercise it until I restored a good low resistance connection when it is put in the ON position. The four wires from the switch were inserted into the terminal blocks on the front of the disk drive. A doubled set of wires from the Disk Unlock lamp on the main console was plugged into its spot on a terminal block. 

An end of a wire snapped off the pin connector that was plugged into a terminal block - but I soldered it back together easily. 

SMS POWER CARD SNAPPED OFF - SIGNS OF PRIOR DAMAGE AND BAD REPAIRS

I found that the card was snapped off at the fingers. One of the two finger sections showed signs of a prior break and a repair using some kind of liquid metal squeeze on material. It was also wrapped in black vinyl electrical tape, probably to keep the parts together.


This is the means of delivering 115VAC hot and neutral to the disk drive, as well as a good ground connection to the 1130 frame from the disk drive. I could directly wire this up, but that would not match the way that IBM connected the disk drive. 

DESIGNING NEW SMS POWER CARD TO BE FABRICATED

I fired up KiCad and began to design a compatible SMS power card. Once it is fabricated by JLCPCB I can use one to repair the disk drive connection and keep a few for other possible uses. I think the SSM museum could use one so I will send one to them. 

Tuesday, November 19, 2024

Assessing a location for the Virtual 2315 Cartridge Facility interface board

MOST COMPONENTS SOLDERED ON INTERFACE BOARD

I had a few hours in the workshop in between time spent with family visitors. I soldered on the connectors, installed the pins that allow me to hook up the cable connector from the 1130 controller logic, soldered on a cable that plugs into the disk drive, and a few other components. I still need to install the voltage regulator, resistors and capacitors. 

TESTED CABLE ROUTING AND MOUNTING POINT FOR BOARD

I had to find a potential location for the interface board where the cables from the disk drive, 1130 controller logic and emulator box can be routed simply and neatly. I did find a good spot, as you can see from the temporary mount with cable ties. 

I will drill and tap for the mounting screws along the left side of the interface board then work out a mount point for the right side. 

Parts arrived to build Virtual 2315 Cartridge Facility interface board

PCB ARRIVED ALONG WITH THE PARTS

This board is the interface between the IBM 1130 disk controller logic, the 2310 disk drive and the modified RK-05 Emulator that together form the Virtual 2315 Cartridge Facility. The cable from the CPU that normally would plug into the disk drive will plug into this new board. A cable attached to this new board will plug into the disk drive. A pair of ribbon cables connect this board to the RK-05, passing most of the signals between 1130 and disk while processing all the data related signals inside the emulator.


FINISHING UP THE FPGA AND C CODE TO BEGIN TESTING

In order to start testing with the 1130 and disk drive, my modifications to George Wiley's RK-05 Emulator must be installed. The 2310 disk drive differs from the DEC disk drives in quite a few ways. As well, my notion of a hybrid of real disk drive plus emulator is unique. 

I will do some final simulations of the FPGA logic before installing it on the FPGA chip in the emulator. The emulator FPGA works hand in hand with a Raspberry Pi Pico that manages the SD Card where the cartridge images are stored, thus there are some Pi side C code changes needed.