RESTRUCTURED WRITE TEST PLAN SLIGHTLY
In the previous tests, I read in cylinder 0, head 0, sector 0, modified just a few words manually, and then wrote it back to C0 H0 S0. That left the remaining data from the original 2315 cartridge image intact, but it was not optimal for my testing.
My new plan uses my core memory loading tool on the IBM 1130 to load the buffer with a known pattern, then I just do the write to cylinder 0, head 0 and sector 1. A second use of the memory loading tool will zero out the buffer location before I do a read of C0 H0 S1 to see what comes back.
As usual, I will be capturing the signals with the logic analyzer while the write takes place. I will store that as an Excel file and analyze it with my Python programs. Lastly, I will unload the mini cartridge at the end of the test, move the microSD card to the offline tool, mount it on my PC and look at C0 H0 S1 with the Showsector.exe Python program I wrote.
MY TESTING EXAMINED THREE THEORIES FOR ISSUES DURING PRIOR WRITES
I changed the logic to eliminate any chance that the cartridge ready condition is being glitched by errors over the SPI link between the Raspberry Pi PICO and the FPGA inside the main unit of the Virtual 2315 Cartridge Facility (V2315CF). It appeared that the write state machine erroneously reset to idle a few times in the midst of handling the writing of a sector from the IBM 1130 to the virtual 2315 disk cartridge.
Another theory was that the power to the main V2315CF unit was having issues triggering incorrect behavior. The final theory is that the clock signal as it is received by the IBM 1130 electronics is ringing or malformed, inducing sporadic errors in the IBM disk controller logic rather than in my logic.
5V POWER SUPPLY EXAMINATION
I set up the scope to trigger on the 5V input go the main unit just in case it wasn't able to support the instantaneous demands of the V2315CF. I could also monitor two internal voltage levels in the V2315CF produced by voltage regulators for 3.3V and 1.2V used with components such as the PICO and the FPGA. The 5V is used for terminator and driver circuits producing signals across the ribbon cables to the IBM 1130 and the internal disk drive, while the other voltage rails depend on 5V for their inputs.
Watching the 5V input from the power supply module into the V2315CF main board showed me significant ringing on the line. It was a periodic ring, occurring roughly every 30 microseconds. That corresponds to a frequency of 33.3 KHz and is likely the result of the DC to DC converter saving power by turning its higher frequence switching action on and off because the load from the V2315CF main unit is not high enough for the module to run continuously.
It is a module rated for 10A output at 5V and thus just loafing along in this role. The terminator resistors for the RK-05 disk drive application are 178 ohms from the signal line up to 5V and 383 ohms from the signal line down to ground, hooked to about 55 signal lines from the main unit.
If all signals are outputs and set to high, the resistor pairs would draw about 100ma in total. If all signals were outputs and all were pulled to low, the draw would be 1.5A. If it were all inputs and they are all pulled low by the source, it could demand the same 1.5A from the supply. The actual requirement is going to be somewhere in the middle and dynamic, varying as signals are wiggled by the source and the main unit.
The DC to DC converter on the power supply was chosen to support up to three of the RK-05 emulators at a time, The load from the electronics on the main unit itself are probably in the range of 600 to 700ma. Thus with three units, max load from terminators of 1.5A and 1.8 to 2.1A for the combined main unit draw, the converter is driving 5-6A which is right in its design range.
In my application, most signals do NOT have termination resistor pairs on them. This sharply reduces the current demand of the terminator board, so that even with most signals asserted low the draw is down around 500-600ma. Add in my main unit electronics demand of 600 to 700ma, and the load on the converter is just a bit over 1 amp. I suspect this relatively light load is why the converter is dropping in and out of economy mode, producing the ringing as it switches back on at the 33.3KHz rate.
PLAN TO RESOLVE THE POWER SUPPLY NOISE
I plan to add load so that the DC to DC converter in the V2315CF power supply module (TOBSON EA50 dropping the 1130's 12V down to 5V) will remain out of the economy mode that is producing the bursts every 30 microseconds. I will add 2.5 ohms of resistance able to dissipate the 10W of power this will consume.
I will also look to quence the ringing by adding filtering capacitors at the input to the V2315CF main unit. A 100 uF low ESR electrolytic in parallel with a .1 uF ceramic should minimize ringing even if the converter does drop into economy mode.
LOOKING AT WRITE CLOCK SIGNAL AS IT ENTERS THE IBM 1130 CIRCUITRY
Finally I monitored the clocking signal produced by the V2315CF that is sent to the IBM 1130 disk controller logic and causes it to output the serial bit stream that is written to a 2315 disk cartridge by the internal 2310 disk drive in the 1130 computer. It looked perfect when monitored on the source end at the V2315CF but I set the scope and logic analyzer to watch the destination in the 1130 for any signal abnormalities.
The signal looks terrible! It pulls up to a max of 2V, has a very slow rise time indicative of the substantial capacitance of the signal path between the 1130 logic gate and the V2315CF main unit, and there is a plenty of ringing at the falling edge.
It has a 1V undershoot and a max level of under 2V for logic high. Nominal voltage levels for IBM Solid Logic Technology (SLT) are 0 and 3V. Fortunately SLT quite tolerant of negative voltages on the inputs, but the SLT transition voltages (max logic low voltage and minimum logic high voltage) are 0.3 and 1.8V respectively.
The ringing of the falling edge goes just above 0.3V although its duration is under 10 nanoseconds, which is too short for most SLT gates to switch. The max level is very near the minimum acceptable level for logic high. Most SLT input gates are diode-transistor logic (DTL) and look like this:
The diodes and transistors in SLT are germanium with voltage drops close to 0.3V each, which I have indicated on the diagram. If all the AND inputs are at the nominal 3V level. the voltage at the thick black vertical line would be 3V due to the voltage divider of the 2K resistor to +6V, the 5K resistor to -3V and the two diode voltage gaps. The voltage at the base of the transistor would be 2.4V, thus the transistor conducts to pull the output low. Since this is a NAND circuit, that is the correct behavior.
When any of the inputs is sinking to ground (logic low), if the actual voltage of the input is 0.3, the effect of the diode drop is to make the thick black junction drop to 0.6V and the transistor base sees 0V, so it is cut off. The transistor must see at least 0.3V for its base-emitter junction to conduct, thus the thick black junction needs a bare minimum of 0.9V.
After many runs capturing the same writen data, but with slightly different results, it seems possible that the 1130 was seeing an extra clock transition, relatively rarely. The 1130 stays in sync for more than 12 data words, sometimes more sometimes less, but then sends an extra bit or drops a bit. That could be due to glitches on the line.
ODD OBSERVATIONS DURING THE TESTS
I did see a few things that don't make sense to me when looking at the logic analyzer traces and the results of what was captured and written to the RAM of the V2315CF and thus to disk. I will cover them here because achieving reliable write functionality requires that I understand what is going wrong so that I can develop a solution to each cause.
Apparently missing instances of catch when word correctly captured
Below is the capture of the sync word - at the end of the preamble of a long string of zero bit cells, the pattern 1 1 1 1 0 indicates that we found the sync word. The bit cell just to the right of the vertical red line is the start of the first bit of the first word of the sector.
The bottom trace is the diagnostic output catch which is should be 1 only when my logic detected that the bit cell was for a data value of 1. The trace above it is the -Write Clock Phase B signal that is the clock we generate and send to the 1130. Atop the clock line is the output from the 1130, the signal -Write Clock and Data which is inverted logic so high on the trace is a 0 and low is a 1 value.
When the clock signal -Write Clock Phase B is low, it defines the half of the bit cell that represents a clocking pulse. The value of the -Write Clock and Data for the first half, the clocking pulse, will be a logical 1 which is low since that signal line is inverted. When the -Write Clock Phase B signal is high, this is the data half of the bit cell and we look at the predominant state of the -Write Clock and Data signal to pick up the data value. A low output indicates the data bit value is 1.
Thus in this trace, we see that during the data half of the bit cells, we have low on the output line for four bit cells, giving us four bits of 1, followed by a bit cell where the data half has a high on the output meaning a bit value of 0. That represents the sync word pattern 1 1 1 1 0 and we have properly detected sync. Note that my catch output is high for the four bit cells that are a 1 and low for the last, showing that my logic picked up the pattern properly.
However, in the next section of the trace, the first data word being captured, we seen some places where catch should emit a 1 but did not. The word being transmitted is x8080, which when reversed to write on disk would be the pattern 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 and its four check bits will be 1 1 0 0 to pass the error checking algorithm. The data received was stored in RAM and the disk as 8080, so we know that it did read properly.
We see the data extracted from that first word and the check bits. The values of the -Write Clock and Data signal are correct and represent the value 8080 plus a correct check bit pattern of 1 1 0 0 but the catch line seems to have missed the check bits that were 1. It turns out that this is a self inflicted error, see my Verilog logic producing the signal catch below.
At the falling edge of -Write Clock Phase B when we are in the stage of the state machine that is collecting data words, I capture the inverted value of the signal -Write Clock and Data to emit catch. Foolishly, however, I only do this for the first 16 bits of the word being detected. I zero it out for the four error checking bits.
My python program that interprets the excel spreadsheet stored from the logic analyzer run uses catch to detect the value of every bit, including the error checking bits, therefore it does not correctly check the ECC value. Look at the results of the program below and you will see that it flags the first word, 8080, as having an ECC error when it is only because my diagnostic output catch failed to emit them.
By the time we get to word 5, however, we have a true issue with the logic which I will cover in the next section. Meanwhile I will correct the verilog code to include the ECC bits in the catch signal.
Bits emitted by 1130 are out of sync with the detected values
The sequence that I wrote from the buffer in the 1130 was 8080, 6969, 0000, 0000, 0002, 2000 and other data - the V2315 gets it right for quite a while, judging by what was written to RAM. It only goes off when it is capturing data I wrote as F000 that it recorded as 01E0. This is a run I did after I completed the logic analyzer capture, so the results are a bit different than what I see in the spreadsheet and logic analyzer trace.
Going by the data captured in RAM, it captured 0002 and 2000 properly, as shown below. The 1130 has correctly produced the pattern for 0002 (inverted 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 with ECC bits 1 1 1 0 and we saw that.
Similarly, the next word (x2000) is correctly captured and the logic analyzer trace looks good.
It is only when we get down to around word 50 that we see the capture go off the rails during the final test run. At least through word 10 everything was recognized properly. There are a bit less than 800 bit cells between the last known good word and the first known bad word. Sometime in the 116 microseconds that span took, a bit was shifted off.
I turned to the run where I have the logic analyzer capture and produced a spreadsheet from it. When I look at the trace I see that the 1130 and V2315CF got out of sync by the time of word 5. It should have been reorded as 0002 just as we see in the picture above, but it came out as 0004 with malformed ECC bits.
Somewhere from the correctly placed bit 15 (next to last bit) of word 2, which was decoded as x6969, up to word 5 bit 2 (second bit) which should have been a 1 but the 1 is shifted to the right one bit. All the 1 bits we expect are shifted to the right one bitcell from this point forward.
The timestamps in the spreadsheet and the logic analyzer trace shows that the bit cells are in the correct place, it is the bit value sent by the 1130 that has shfited to the right. On this run, we saw another shift of a bit to the right somewhere from the end of word 9, which should have been 1236, and the first few bits of word 10 which should have been captured as 1237. What was captured for word 9 was 246C and word 10 was grabbed as 48DC. This is the second shift to the right during this run.
Thinking about how this could happen, it suggests that the IBM 1130 is how we are getting out of sync. The logic that transmits the data is driven by the -Write Clock Phase B that is generated by the V2315CF. That signal enters the logic of the 1130 disk controller in two places. The first generates the shifting operations that move the bits of an 1130 data word out serially bit by bit. The second controls the multiplexing of the -Write Clock and Data output signal between the 1 that is sent for the clock half of the bit cell and the data bit sent in the second half of the bit cell.
Above we see that when a write is underway (+Write Select is high), the -Write Clock Phase B drives the -Counter Sample signal low while the clock is high. This means during the data half of the bit cell. Also, during a write (+Write Select high) whenever +Bit Counter Gate is high and -Bit Counter E is high, the signal -Shift Gate is asserted low.
Each word from the buffer in memory is fetched into the disk controller and then the bits are shifted out one by one to write serially on the disk drive. Hardware in the controller counts out the bits, so that the data word, which consists of 16 bits, is shifted out and then four error checking bit are emitted. The counter counts out the 20 outgoing bits.
Bit counter E is on during the four error checking bits, otherwise it is off. Since it is inverted logic, when -Bit Counter E is high, we are outputing the 16 data bits of the word then low during the rror check bits. This means that the signal -Shift Gate is low when the +Bit Counter Gate is high and we are handling the data bits.
During a write, when we are in the data half of a bit cell, the signal -Counter Sample is low.
The actual pulse that causes the data to shift is triggered by a pulse called -Shift SP if the signal -Shift Gate is low and a pulse arrives because -Counter Sample goes low. From above, -Counter Sample goes low when -Write Clock Phase B goes high which is when we are entering the data portion of the bit cell. The single shot timer delays this then activates the shift pulses and also increments the two bit counter for the ECC value if the data bit being transmitted is a 1.
The output from the 1130 on -Write Clock and Data is a line that emits a 1 or 0 value (inverted) and the value emitted depends on whether we are in the clock half of the bit cell or the data half. The bit cell is defined by the -Write Clock Phase B signal coming from the V2315CF - when that signal is low, it defines the clock half of the bit cell and when it is high we are in the data half.
It is only active when +Write Select is high, e.g. when we are in a write. The output is low when -Write Clock Phase B is low, meaning we send a 1 bit during the clock half of the bit cell. The output is also low during the data half of the bit cell if the bit at the end of the shift register is high and -Bit Counter E is high (we are processing the 16 data bits of the word) - this means that if the end of the shift register is a 1, we assert -Write Clock and Data low during the data half of the cycle.
Finally, if we are handling the four error checking bits after we shifted out and transmitted all 16 data values, then +Bit Counter E is high and as long as the two bit counter for the ECC value is not zero, we assert -Write Clock and Data low to output a 1 as an error checking bit. The two bit ECC counter is incremented by this output. As the bit counter counts out bits 17 to 20, we send out a bit value of 1 when the ECC counter is non-zero and then send out a bit value of 0 once it becomes zero.
This is how we calculate the correct number of 1 bits to send in the ECC bits so that the total of all 1 bits transmitted becomes an even multiple of four - the two bit counter rolls over to zero if it reachs 3 and is incremented. This produces the only valid ECC patterns 0000, 1000, 1100, and 1100 as these occur when the initial value of the ECC counter was 0, 3, 2 or 1 respectively when we finished counting the 1 bits in the 16 bits of the data word.
The failure we are seeing is that we are missing a shift of the data and not incrementing the bit timer even though we have a bit cell (a complete cycle of the -Write Clock Phase B signal). The bit cell comes in, generated by the V2315CF, and we emit the 1 value during the clock half of the bit cell, but since we didn't see the high value of -Write Clock Phase B during one of these glitches, it didn't drive -Counter Sample and we didn't produce the shifting and counting pulses. Whatever bit value was in the end of the shift register is just transmitted another time when this situation occurs.
This has to be caused by the poor signal quality observed where the -Write Clock Phase B signal enters the 1130 at gate A, compartment C1, slot K6, pin B03. Once I correct the signal quality, I expect the slipped bit problem will disappear.
PLAN TO FIX THE QUALITY OF THE CLOCK SIGNAL ENTERING THE 1130
I had installed some weak terminator resistors for this output, which don't seem to have the oomph to pull the signal line up even to 2V because of the voltage divider formed in the path from the terminator to the input of the gate at pin B03 of slot K6. I will restore the 169 and 249 ohm resistors at R33/R34 of the terminator board. That should also help with the ringing observed on the scope.
I will observe the signal using the scope after making the change to the terminator resistor pair. Assuming I see the signal rise up closer to 3V, the rise time improve and the ringing ameliorate, I will run new tests to check the functionality of the write to the V2315CF.

























