Sunday, March 27, 2016

Converting 1442 adapter for both mirror and virtual mode, plus plotter restoration start

More distracting tasks to keep me away from the 1130 project. My daughter's car is leaking oil around the valve covers, which causes smoking oil entering the ventilation system to the detriment of the riders. I bought new gaskets and parts and did the repair myself.

A gasket on the cam chain tensioner is also a source of leaks, so I replaced that. This involved partially disassembling one of the camshafts to get access for the replacement. Two special tools, easily found on ebay, were required.

SAC INTERFACE FOR ADDING PERIPHERALS TO THE 1130

Implementing mirror 1442 reader/punch

I began coding that additional logic in the fpga first, so that I can first verify that it 'does no harm' to the existing virtual 1442 functionality. I was surprised by how lightweight the change is. Only three functions force data onto the 1130 bus - XIO Read, XIO Sense ILSW and XIO Sense Device. I used my mirror versions of these, which capture the data that is written by the real, functioning adapter electronics inside the 1131 instead of driving data onto the bus as the virtual driver must do.

Next, I have to skip over the steps in the main process which trigger the 80 emitter interrupts on IL0, since the real adapter electronics will do this. I also have to skip over the step that triggers the completion interrupt on IL4, for the same reason. One signal, which indicates whether we are in mirror or virtual mode, will direct the main FSM to take or skip these steps as appropriate.

The remaining change is in the pre-read buffer logic, which now has to capture the data written by the real adapter electronics (via my XIO Mirror Read module) and store it into the buffer. This is driven by a new mirror read process that triggers a buffer write at the end of an XIO Read.

The last little bit was the special transaction from the PC that will set or unset the mirror mode signal. I chose the Write Device Status transaction (command code 6) and the low order bit will switch the adapter to mirror mode if set, otherwise it will flip the adapter to virtual mode.

CALCOMP 565 RESTORATION AS IBM 1627

I picked up the plotter, which does appear to be complete as far as parts, with the only visible damage being the dented and bent main drum upon which the paper is carried under the pen. The tasks ahead are:
  1. Repair the drum,  returning it to a constant radius cylindrical shape
  2. Get accurate pictures and colors for the control and side panels of a 1627
  3. Repaint side panel to IBM color (IBM gray)
  4. Repaint control panels to IBM color (black)
  5. Create and attach white labels on control panels
  6. Remove Calcomp label on front bar
  7. Create and attach IBM 1627 label  and "made in america" placard to front bar
  8. Reassemble plotter
  9. Attach plotter to slave fpga board
  10. Test and adjust plotter
As far as task 2, I collected quite a few pictures that show me the colors and labeling with enough fidelity that I can paint the plotter properly and fabricate realistic labeling. I have powder coating colors corresponding to both gray and black as used by IBM in the 1130 generation. I will just need to sandblast the panels to be painted and then find a powder coating facility I can use.

Task 1 - drum repair - is going to be the most complicated part of the project. The drum has a big dent and that has also bowed the cylinder out of 'round' in a couple of places. It is an aluminum drum, this inherently soft and ductile, which might allow me to get it close enough to true. If I can, then I can spin it with an abrasive to even out very slight variations.

Another possibility is to make a form out of wood or plastic that matches the desired internal volume of the drum, allowing me to force the aluminum down over the form to true it up. I am skeptical about this method but it is worth considering. As well, I need to think of other repair methods.

Another possibility is to find a substitute aluminum hollow cylinder whose ID and OD match this one. Cutting it to length will be relatively easy and then I can simply replace the dented drum with a new equivalent. The key, of course, is to find a readily available drum with the magic combination of inner and outer diameters plus sufficient length.

I disassembled the drum to find it is a light easily bent surface that had sound deadening foam on the inside. The cylinder has small pop-riveted tips that will fit the perforated holes in any paper inserted into the plotter. These would be quite hard to move to a replacement drum surface.

Dented drum

out of round condition

Internal supports and sound deadening foam

Pins riveted into drum surface

Inside view of pop riveted pins

Saturday, March 26, 2016

Up and running on Vivado toolchain, plus work on mirror 1442 mode

SAC INTERFACE FOR ADDING PERIPHERALS TO THE 1130

Converting design to Vivado toolchain


I worked on the learning what it takes to import the logic over from ISE to Vivado, using the simpler slave fpga code first. Once that synthesized, but of course couldn't create a bit stream since the slave board fpga type (Spartan 6) is not supported in Vivado.

I moved onto the main board, where I had a FIFO whose IP had changed since I generated the module I was using. I got Vivado to upgrade it to the Artix 7 version and resynthesize. Next up was getting the UCF entries converted to some new 'XDC' format used by Vivado.

This learning curve chewed up quite a bit of time until I figured out how to build an XDC file that was equivalent to my old UCF document. Then, the actual entry of the file was an hour of tedium. I saw that the new board had the same connectors as the old board and the same number of IO connections from the fpga, but the pin numbers on the Artix 7 chip are completely different from the pin numbers of the Spartan 6 chip.

The same connector position but it requires a change of the pin number, which means changing 100 entries in the new constraint file. Sigh - another hour of tedium. Fortunately, I am getting closer to have a successful run of the toolchain through to bitstream creation. Syntax has changed to use TCL language, so a UCF entry for a std_logic_vector named FD would be FD<0> etc  but in TCL it is {FD[0]} etc.

My block RAM used as buffers for 1403 and 1442, among others, required a new IP generation to use the native BRAM on the Artix 7 chip. Once I get those straightened out and my constraints file sorted properly, I managed to run the toolchain through to a bitstream.

Implementing mirror 1442 reader/punch

Fellow 1130 system restorers have a need for a variant of my virtual 1442 functionality - a mirror adapter that will capture card images being read and/or punched on a real 1442, so that a PC based file is captured. I began the work of altering the virtual 1442 function to provide mirror capability, switchable by the user of my SAC Interface Box.

A mirror device will follow all the XIO instructions, cycle steals and interrupts that are involved with the use of a real device, shadowing the behavior in order to grab the data that is being transferred between the reader/punch and the 1130. A mirror device needs to be fast enough to have the data written or read picked up by the PC side program and put into a file, before the next card is read or written.

In order to use the virtual 1442 capabilities, the machine needs to have additional signals wired between the 1130 and my box. The SAC cable on an 1130 does not display nor trigger interrupts on level 0, which are used by the reader/punch to transfer the data for each card column. Mirror functionality doesn't actually need to see when IL0 is active, while virtual functionality needs to both observe and trigger IL0. The 1442 does not use cycle steal.

My Python program on the PC side will get a copy of the XIO Control command used to start reading a card, start punching a card, select the alternate stacker, or feed a card without reading. The Python program then writes the card image from a PC file into the pre-read station buffer of the fgpa. With mirror function, these are assumed to always be blank cards, so that is what is pushed down by the Python code.

When the real 1442 card has data approaching the solar cells, for each card column, it triggers an interrupt on IL0 and the software on the 1130 issues an XIO Read to capture the card image into core memory. I just need to grab the data word that is being written into core for each of the 80 XIO Read instructions, overwriting the pre-read buffer with those contents. At the end of the 80th column, my function will claim to the Python program that it saw an XIO Init Write instruction, to have the PC side do some things before the mirror card reader copies the contents of the pre-read buffer to the pre-punch station buffer.

For a card punching operation, the IL0 interrupts cause the software in the 1130 to issue XIO Write commands that fire punches in the current card column of the card in the pre-punch station. The mirror adapter will OR the bits from the word written by the XIO Write into the pre-punch buffer location, since a real punch will add holes atop whatever was in the card before. At the end of the cycle, it also mocks up an XIO Init Write command to have the PC side do its thing

The PC side will see the false XIO Init Write and fetch the contents of the pre-punch buffer, which has has the N-1 card image that was read plus any new holes punched. If not punching, or simply doing a feed, the data in the pre-punch buffer is the N-1 card that was read or fed. This models the real 1442 which has multiple stations where cards sit during operation. There can be two cards sitting in the machine at any time, one ready to be read and the next, which already passed the read station via read or feed, is ready to be punched.

The PC program for the mirror 1442 will fetch the pre-punch buffer on every read/feed/punch except for the first, since the first time a new set of cards is put in the hopper, the pre-punch station was empty and nothing comes out of the hopper. The read or feed will have advanced card 1 from pre-read to pre-punch, but nothing moved from the pre-punch to the stacker. On subsequent cards, the N-1 card read will pop out into the stacker. The Non Process Run Out (NPRO) button flushes any cards inside the machine to the stacker.

I have to add a command that switches the 1442 adapter between mirror and virtual modes. The user has to pull down a signal inside the 1131 when running as a virtual device, to block the action of the real 1442 adapter circuitry, then remove that pull down if using the physical device. This should be a switch operated by the user, rather than a jumper wire.

Thursday, March 24, 2016

Various small bits of progress

I spent most of the day Wednesday at the Computer History Museum where we were struggling with the 1402 card reader/punch for the "Connecticut" machine. It was misbehaving in multiple ways and required a convocation of many of the team to figure out what was going wrong.

We had one problem in the morning that blocked the basic Non-Process Runout of the reader - which went away as I examined the wiring going into a group of cam based switches. Most likely a flaky connection but until it is failing again, nothing we can do now.

The machine was substantially out of timing - there are specific points where the clutch engages, the picker knives push a card into the machine and where the microswitches detect if a card is at various stations along the read patch. This also determines when the 1401 processor looks for holes on the card during the 12 'row' times.

No idea how it got that far out of whack, although I heard indirectly that there were some major card jams back just before this reader began misbehaving last week. I don't know if there is a way that mishandling while removing a jam could shift the timing, but we got it dialed back in. Ten minutes before the 3PM demonstration for the public, it began reading correctly. Just in time, we turned it over and the docents had a successful session demonstrating the machine.

I received my new laptop and also spent some hours updating, configuring and beginning to install the important programs and files on the machine. Like almost every laptop, it has an accursed Synoptics touchpad. I don't like and don't want to use the touchpad, I just want to use the mouse stick between G, H and B on the keyboard and the two 'mouse' buttons.

I turn off the touchpad part, work away and sometime later, I hear a sound as the damned driver turns the pad back on. It won't stay off. Discovered a 'feature' of the driver is that when touched twice in succession in the upper left corner, it turns the touchpad back on. Fortunately, a somewhat obscure setting lets me disable this behavior. Now working the way I want.

In my spare time, I converted fourteen fluorescent fixtures to use LED bulbs - a bit of rewiring inside to eliminate the ballast, otherwise pretty straightforward. A dozen regular bulbs also got the treatment. Most involved ladder work and a bit of contortion, to the chagrin of my muscles.

SAC INTERFACE FOR ADDING PERIPHERALS TO THE 1130

Switching to Vivado toolchain and preparing to use the more powerful Artix 7 fpga board

I installed the latest Xilinx toolchain, Vivado, which supports the new fpga board with the Artix chip (but will not support the Spartan 3E and Spartan 6 boards I own). I moved the SAC Interface logic for the main fpga board over to this system and began working through the compatibility issues - generated IP either out of date or missing, plus a replacement for the UCF file that previously was used).

Once this is synthesizing through to a generated bitstream, I will plan to swap the fpga boards and give this one a test. Once it works, I will have reams of space for logic functions, buffers and the ability to store major amounts of data in the 256MB of DDR3 memory onboard.

Implementing physical paper tape reader/punch (1134 and 1055 equivalents)

The dual relay board arrived which will permit me to start controlling the motors of the paper tape reader and punch mechanisms. I can't punch until I have my driver board but I can do some testing of the reader. I began wiring this up.



Tuesday, March 22, 2016

Working on high speed link and physical peripheral functionality

SAC INTERFACE FOR ADDING PERIPHERALS TO THE 1130

Debugging the resilient high speed link between fpga boards

I will go over my hamming code VHDL with a fine tooth comb, as well as the processes that do the error checking on my high speed SPI links between master and slave fpga boards. I need to find the reason for sporadic conditions that cause high error rates, usually while operating the 1130, which might be triggered by some signal from the 1130 changing which is assigned to a link bit position susceptible to some design flaw. I don't think this is the cause, but it is a precautionary check.

Another potential cause is ground bounce due to the inadequate grounding between the 1130, SAC box fpga and slave fpga. Each signal is sent over a twisted pair in the SAC cable, which isolates the signals from common mode disturbances but the cumulative effect of the signals changing may be shifting ground between the three units. This is more likely.

It was indeed the grounding - a very solid ground connection to the SAC Interface unit and nothing to the slave fpga board worked wonders - zero errors. Onward to testing at least parts of the plotter and paper tape interface.

I should be able to do diagnostics that confirm the basic process from XIO Write issuance through completion interrupt and reset. That can happen with the plotter switched off, then when the plotter logic in the slave fpga is certain to be issuing the commands to the plotter interface hardware, and similarly to the paper tape units, I can be in position to start testing with real hardware in a few days.

Implementing physical plotter (1627 equivalent)

I will set aside the work on the Strobe 100 interface that appears as a 1627 plotter, since I will be getting and restoring a Calcomp 565 which is the exact plotter that IBM sold as the IBM 1627 model 1. I was at the point of tuning the timing to suit the slower speed of the Strobe, which will not be needed

As explained above, I did continue to test just to confirm that my basic logic and interactions between master and slave worked properly. That is, I would issue an XIO Write to the plotter, see the slave receive it, see the slave fire the command signal to the plotter interface, then see the master fpga trigger the interrupt. I should see appropriate sense in the DSW, and the interrupt trigger should only go away when the reset bit is set in the XIO Sense Device command.

I loaded up diagnostics to let me see what the master was doing. The slave has LEDs displaying the commands issued to the plotter interface. With those done, I went out to the system and fired up the test. I discovered that the master set up the command and thought it had fired off the transaction to the slave, but the slave sat inert. Further, a signal on the master that should have reflected the transaction request was not active.

Changing both sides for new diagnostics increases the agonizing period of inactivity to more than 50 minutes. A quick inspiration based on test results, changes developed in just a few minutes, then 50 minutes of delay to make it happen. Fortunately, this is a pretty simple transaction.

The master raises transaction and doesn't drop it until it gets the response. The slave sees the transaction, does its thing and then raises the response. When the master sees the response, it drops the transaction. The slave goes back to wait for new transactions once it sees the previous transaction signal drop. Nicely interlocked and not timing critical.

When all was finally set, I went out to debug the transaction flow. To my chagrin, the high speed link was back to huge error rates. Back to the link - that has to be rock solid before I can move on to the peripherals.

Implementing physical paper tape reader/punch (1134 and 1055 equivalents)

The paper tape reader needs one relay activated by the slave fpga to drive the motor and multiple sensing signals which are based on simple switches. Thus, I don't need any voltage shifters or other interface, simply a relay driver circuit.

The paper tape punch has to drive a relay for the motor but also eight output signals to drive the punches. Feedback comes from simple switches, those are easy. I will build 8 transistor driver circuits to feed the punch circuitry, plus two relay drivers for the reader and punch motors. When this is ready, I can wire up the reader and punch to the slave fpga and begin debugging tests.

I selected the components that will let me build this using off the shelf boards designed for hobbyists. A twin relay board will let me drive the two motors. An 8 channel power driver board can drive up to 100ma per channel at reasonable voltages, acting as a 8 bit shift register and gated output. Level shifters allow the TTL level boards to be interfaced to the LVCMOS 3.3V fpga pins. A small box, connectors, wiring between boards and I will be ready to go. The parts will arrive in a few days.

Monday, March 21, 2016

Virtual 1403 printer function completed, moving on to a Calcomp 565 plotter restoration to create a real 1627

SAC INTERFACE FOR ADDING PERIPHERALS TO THE 1130

Implementing virtual 1403 printer

For my first test of the day, I set up latches to record bit 1 (channel 2) as it is being written into the buffer for lines 1 to 4. This should match the pattern I am sending from the Python program, 0-1-0-1 unlike the detected pattern when I looked at the output of the buffer, 0-1-1-1

One teeny flaw in the latching logic, so none of the latches worked. Thirty minutes to correct before I can retry the test. At least these tests can occur without powering up the 1130 - they are focused on actions that occur between the Python code in the PC and the logic in the fpga.

Interesting. The input to the memory for lines 1 to 4 during the write cycle when the buffer write enable is set up was 0-1-0-1, exactly what I should see. This leaves a few possibilities to explain the problems I am facing. I need to work through the cases, unfortunately in half hour or longer intervals. I say longer, because as a retired person, I have the distractability of an ADHD afflicted child. This means that while waiting for the toolchain to complete, I wander off and may not return for a while.

I saw that the buffer had the right input (bit off) at the time I was setting up to write to the memory for line 3, but when it was fetched during the carriage movement process, the bit was now on. I altered the latches to show me the bit for the cycles after it has written, also to latch if the output of the buffer is set after the writing cycle.

Line 3 is not disturbed by writing and not disturbed if I use XIO Control (space one line) commands to move past line 3. I am forced to conclude that my problem is caused only when performing carriage skip processing, although the mechanism by which this can happen is obscure. I have to think of further diagnostic tests to determine what is actually occurring.

Assumed I had a race hazard on changing of the address to the buffer memory, which I blocked by idling one cycle before changing, but the flaw is still present. This bug is so frustrating. Perhaps I am overwriting words in the buffer as part of the seven 'write special data' transactions that are needed to load the 66 word buffer, ten words at a time.

If you can't spot the race hazard, register the signal. I set the carriage tape buffer process to lock in the line number as the buffer address while the carriage movement process is in its timing loop, simulating the time delay of 1403 printer movement, well away from the cycles where it is checked against a skip command. That did the trick. I now have the virtual 1403 printer function working exactly as I wish.

IBM 1627 RESTORATION (REALLY CALCOMP 565)

My friend Bob offered a Calcomp 565 that I can try to restore. It is in pieces and the drum is dented, but there is a good chance that I could this back in operating state. IBM sold the Calcomp as the IBM 1627, for use with the 1620 and 1130 systems. If I restore this, it would replace the Strobe 100 I am currently using as a 1627 substitute.

Calcomp 565 - comes in various skin colors such as teal or black
I should consider changing the paint and labeling to be as close as possible to the IBM appearance. I will need to repaint the outer cover, paint the panels that hold the switches/knobs, and create the right decals for the labeling of panels and the front bar.

IBM 1627 - different skin and panel colors, plus changed logo

Sunday, March 20, 2016

Problem with 1403 function isolated to 'write special data' transaction from PC

SAC INTERFACE FOR ADDING PERIPHERALS TO THE 1130

Implementing virtual 1403 printer

The definitive diagnostic output was to a set of latches I set up to check the state of bit 1 of the carriage tape buffer word for various print line numbers. What I was pushing down from the Python program were the following four words for lines 1 to 4 - 0x8000 0x4000 0x2000 0x5000. These mean line 1 has only channel 1 set, line 2 has channel 2 set, line 3 has channel 3 set and line 4 has both channel 2 and channel 4 set. Bit 1 represents channel 2.

Therefore, I should have had bit 1, channel 2, set for lines 2 and 4, but not for 1 and 3. I spaced the printer through the four lines and had found bit 1 set on lines 2, 3 and 4. Not correct, as line 3 should have that channel off.

I did some more skip testing (XIO Write to skip to certain channels on the carriage control tape). I found that it behaved correctly but had a line number one higher than what should be sitting in the buffer. That is, if I was going to match a bit set in line 8 of the buffer, I would match and stop on line 9.

The proof of this was to do a skip to a channel that only existed in the last line of the buffer - such as channel 9 or 12 which I didn't set until the last line. The fpga logic had a runaway carriage - the result of looking for a channel (1 bit) when no buffer word has that bit set.

My problem is in the process that accepts the write special data transaction for the 1403 and places the data words from the transaction into the buffer. Tomorrow morning I will set the latches to watch the words being written and display the active word for given line numbers. This will freeze the transactional engine between fpga and PC, but give me the snapshots I need. At 30 minutes per tweak, it will continue to be a slow pace towards eventual success.

Saturday, March 19, 2016

One nit and 1403 is complete

SAC INTERFACE FOR ADDING PERIPHERALS TO THE 1130

Implementing virtual 1403 printer

I built the test for skipping, which I can perform on the 1130 to verify that my virtual carriage control tape works properly.  I have a sequence of skips to perform, based on the default carriage control tape image for my adapter, and will check that the resulting line number is correct after each one.

My first test this morning was bad due to operator error. I forgot that my skip list for the XIO Write is offset - channel 1 is bit 4, channel 2 is bit 5, etc. I reran with the proper command and the fpga and python behavior differed. The fpga is wrong.

I was at line 1 and did a skip to channel 4, which should have stopped on line 4 since there is a channel 4 punch at every line modulo 4 (4, 8, 12, etc). It stopped on 8 in the fpga based on the displayed line number. Next, I set it to skip to channel 1 and it stopped at line 2 per the fpga.

I need to validate the contents of the tape buffer first, which I can do with my current LED assignment from the fpga board. I can see the top five bits of the buffer - channels 1 to 5. If I do XIO Control (space one line) then I will successively look at all the buffer contents and can match them to what should be present.

While I am running that test, I have the fpga synthesizing a new assignment for the LEDS, to display the top five bits of the skip command issued (XIO Write with the data word bit 4 as top bit, bit 5, the next, etc). That will let me confirm that the search word is correct for the fpga process.

Immediately, I could see that the print line number in the fpga was NOT advancing with successive XIO Control (space one line), thus I was always seeing the same buffer word. That needed to be fixed in order to complete my test validating the buffer contents.

Defect found and fixed rapidly, so a mere 30 minutes for the toolchain process before the next test. Grabbed some lunch while it synthesized. With this, I found a defect in my Python code as it loaded the buffers, corrected it and got right back to testing (not needing the glacial toolchain for the fpga).

I discovered one oddity - the displayed line number from the fpga was one higher than the actual buffer contents and one higher than the place it was stopping. I will review the fpga code to repair this. I made one operator error again - when I set the skip word to go to channel 12, I put in 0x0010 instead of 0x0001, leaving the printer on line 10 and not line 66 as I intended.

However, a retest uncovered a timing condition in my XIO handling logic, with the low bits of a word from core arriving later than the higher bits and sometimes not being latched properly.  I changed my XIO routines to give a bit more time for latching and all is good.

Skipping is working properly, so I can run a final test to produce an intended output file and verify that it produces the desired output including everything being on the proper line number.  I had made the change to the fpga to straighten out the line numbers reported, but the line number assumed by the fpga is always one past the real line number. I just can't see why this is happening.