Thursday, June 18, 2020

Long slow trek building and wiring up connectors for the Apollo DSKY display project

WIRING RELAY MODULE CONNECTOR IN PHASES

There are roughly three categories of wiring running to the Relay Module - low voltage control signals, high voltage power connections, and high voltage lines to individual segments of the EL Panel. I chose to use blue wire for the control lines and yellow for all the high voltage lines.

The first phase was to wire up all the control lines, using the blue wirewrap whose other end will go to the breadboard panel I built with all the transistors to drive +14 and ground to these lines for the purposes of latching or unlatching the individual relays in the module. I routed the wires to the right where I will place the transistor board.

Blue control wires hooked to the Relay Module connector

Second phase was to wire up the sources of 275V AC, 800 Hz which will be routed through the relays to light the segments in the display panel. These were done with yellow wire and routed out the top of the connector to be hooked to the Power Supply module and to two ground pins on the display panel. 

The final phase will be connection of the yellow wires between the display module for the individual segments and the relay contacts that power those segments. These are routed to the left where the display panel will sit. 

BUILDING ELECTROLUMINESCENT DISPLAY PANEL CONNECTOR

The connector for the Display Module has 160 male pins, but I only need to connect to 50 of those locations since I am only lighting up the PROG, VERB, and NOUN digits, the sign for the first register row, and the fixed text and legends. These are all up at the top, from pin 110 upwards.

50 female pins placed in the connector plate

WIRING UP ELECTROLUMINESCENT MODULE,

I then wired all the segments with the yellow wire running to the left, so that when the display is facing forward, the wire will run to the right over to the Relay Module sitting next to it. Each digit has seven segments, thus seven wires. The three areas PROG, VERB and NOUN have two digits each.  

There are some other pins in use, two for the sign character, two for ground, and two for other purposes. I wired the digits individually, each group of seven wires routed through a shrink wrap tube. These are ready to have their other end wrapped onto the appropriate pins of the Relay Module

Yellow wires for individual segments are attached

Tuesday, June 16, 2020

Narrowing in on the communications error serial USB between Arduino and Windows virtual COM port

SPY ON SERIAL DATA STREAM USING ANALOG DISCOVERY

I hooked up my Digilent Analog Discovery and put it in protocol mode, to spy on the traffic over a serial link. I hooked the two digital lines up to pins 0 and 1 of the Arduino which are the serial port RX/TX pair. Once configured for the same 115200, 8N1 I captured what came over the port.

It should have received xC0, x00, x01, x01, x00, x00, xC0 and then sent back xC0, x00, x04, x01, x01, x02, x03, x00, x00, xC0 as the response. Instead I saw this (digilent uses h instead of x to denote a hex character):

hF0 hF0 
hC0 h00 h01 h01 h00 h00 hC0 
hC0 h00 hF0 h04 h01 h01 h02 h03 hF0 h00 h00 hC0
hF0 hF8 

There are spurious xF0 characters as well as a final xF8. The occurrence in the midst of the message coming back causes my problems. 

Now, once I figure out what is injecting these and how to turn it off, I should be able to communicate cleanly. 

Sunday, June 14, 2020

Building control system for the DSKY, based on an Arduino

REQUIREMENTS TO SET OR UNSET RELAYS IN THE DSKY MODULE

The relays in the Relay Module are wired into an array, with seven rows and five columns of relays. In addition there are another column of relays used for other purposes such as lighting the sign segments For our purposes, we will use just six rows of five to light up the two PROG digits, two VERB digits and two NOUN digits. We will also make use of two relays to control the sign in front of the R1 row on the display, and use the flashing relay to make VERB and NOUN flash on and off. 

These are organized so that we select a column by pulling its control line to ground. Overly simply, select a row by feeding +14V. The relay coil at the coincidence of the energized row and column will activate. 

These are latching relays, meaning that they have both a SET and an UNSET control line for the row. To turn on a specific relay, we select its column by grounding the line and provide +14V to the SET line for the row. If we later want to turn it off, we ground the column line and provide +14V to the UNSET line for the row. 

Although each digit on the display has seven segments, the Relay Module uses only five relays to control them. There are eleven valid five bit codes that can be set into a row of relays, for the ten numeric digits and for an unlit condition. The wiring inside the relay contacts converts those five bit codes into seven discrete segment connections. 

USING TRANSISTORS TO SWITCH +14V AND GROUND TO THE RELAY COILS

I want to use an Arduino to programmatically set and unset the relays, forming digits to display on the Electroluminescent Panel module. That microcontroller won't tolerate 14V levels, so I need some method to control the higher voltage by sending signals at +5V. I could have set up 20 relays to drive the +14 and ground requirements for the Relay Module but decided that, due to the low current of these relays, I could use common low cost transistors. 

WIRING UP ARDUINO TO THE TRANSISTORS AND TESTING

I set up 8 NPN and 24 PNP transistors with their bases biased to be off by default. I used a set of breadboards for convenience. Six of the NPN are used to select the six rows for the digit displays, while two are used to select the relays for the horizontal and vertical lines of the sign character. Five pairs of NPN-PNP set the bits of a display code, another five NPN-PNP pairs unset those bits, and there are two NPN-PNP pairs to set and unset the relays for the horizontal and vertical sign segments. 

The reason for using pairs of transistors with the NPN-PNP circuit is that I am switching high side +14V with an input that can't go above +5. I need a first NPN transistor with emitter at ground, biasing the base down to ground so it is by default off. When the first conducts, it pulls the base of the second (PNP) transistor down to ground, causing it to conduct. Normally the base of the second transistor is pulled up to +14V, the same as the emitter. 

I used an LED plus resistor as a load to verify that my circuit is by default off but will conduct to light the LED when +5V is delivered to the base. Similarly, I used the LED and resistor for the PNP circuits to verify that it is off by default but provides voltage to light the LED when ground is hooked to the base. 

WIRING UP TRANSISTORS TO THE DSKY RELAY MODULE AND TESTING

Fortunately, one can faintly hear a click as the relays in the module are switched from set to unset or vice versa. That allowed me to check out all the control lines from my Arduino. I temporarily wired in one row with a column set and unset, verifying the sound of the relay latching and unlatching. 

Next I took some hours to carefully wire up all 32 transistors and their associated resistors and power connections. I finally had all the parts and wires set down on the breadboard, ready to begin testing.

Tested 3174 interface communications with new genuine Arduino Mega 2560, same failures

A bad board was the most likely seeming cause of the failure of the Python code in the laptop and the firmware in the Arduino to communicate correctly. Just ten minutes ago my genuine Arduino was delivered, as there were two possible causes of the problem - bad board hardware or some compatibility issue with the clone Sunfounder Arduino. 

Alas I immediately had the same error. This is frustrating because now we have to delve deeper into the workings to figure out what is wrong, since it appears to be a software defect or some kind of software configuration issue. 

Saturday, June 13, 2020

3174 interface issue narrows down to either my Arduino board or some serial communications issue

REMOVING ITEMS FROM THE MIX TO HELP ISOLATE THE PROBLEM

The problems I am encountering are errors found in the Arduino firmware where it finds that a length code inside a message doesn't match the actual length. To strip away possible causes and do a binary search, Andrew suggested that I remove the shield entirely and narrow down the test to a more pure communications focus.

I modified the firmware so that when it is presented the POLL command over the USB link it returns a fixed error asserting a timeout. The error remained, a length mismatch, which tells us that problem is not in the shield nor something occurring while communicating with the 3178 terminal. 

Reducing the speed of the serial link to 9600 baud from its original 11520 eliminated whatever problem we were having, because I began to get the dummy timeout error which is the correct response. Moving up to 38400 baud reintroduced the length error (garbling). 

I swapped the USB cable for another, in case there was an electrical problem with that. No change. The range of possible culprits is shrinking. Some I can think of include:
  • Windows 10 and its driver
  • The Lenovo L340 laptop USB port hardware
  • The Sunfounder Mega 2560 clone itself
  • Some unanticipated side effect of a code flaw in the firmware
  • Some corruption in the SLIP and PYSERIAL libraries used for communications
  • Some defect in the platformio toolchain that is creating defective code
The most likely is the clone Arduino. I expect to get a name brand Arduino Mega 2560 tomorrow and will repeat the test with that. 

Friday, June 12, 2020

More debugging of the 3174 interface system to drive IBM 3178 terminal

WORKING WITH DESIGNER - ANDREW KAY - TO DEBUG

Andrew has been kind enough to spend time exchanging emails, suggestions and reviewing diagnostic results, hoping that we can get my interface working. We don't know if there is a peculiarity with the 3178, some code that could be improved in Andrew's code, or some hardware problem in my interface shield. 

He has added instrumentation, suggested changes I can make to the code and puzzled along with me at the behavior we are seeing. 

SYMPTOMS AT THIS TIME

When attempting a POLL, which is a one word command issued to the terminal that either indicates it is idle or signals that some action key or other condition has occurred that should be handled by issuing further commands such as READ, we are receiving an invalid message request error. 

Having put a pause into the program, after it initializes the link down to the Arduino but before it transmits a POLL, I can see that something is triggered and we fail before even sending the POLL. A message is sent over the coax during the link initialization and receives a response from the terminal. 

In some cases, it crashes before the pause, but other times I get a chance to send the POLL. That data begins to be received by the Arduino (scoping the Rx pin) but almost immediately it sends some kind of rejection message to the laptop on Tx and we fail. There is no POLL message sent over the coax, it is blocked in the Arduino. 



Plates arrived to construct the connectors for the DSKY components

RECAP OF MY WOOD PLATES AND APOLLO CONNECTORS

The connectors for Apollo DSKY (Display/Keyboard) are manufactured using the individual Malco mini-WASP pins pressed into holes in an aluminum or other metal plate to form some array of pins spaced .125" apart. Since mini-WASP pins are a precious commodity, I designed an alternative that would leave the pins in original condition for re-use after my project is done.

I had Ponoko.com laser-cut my design into thin maple wood, giving me a wood plate that could have the nylon holder of the mini-WASP pin pressed in without compressing or damaging the nylon. I build a stack of a plate holding the pin and an upper plate that allowed only the pin's wire-wrap post through. I could then wire-wrap to make connections and easily remove the wire after I am done. 

PLATES MATCH THE DESIGN AND WORK PROPERLY WITH THE PINS

The plates align perfectly with the male pins on the three DSKY modules I have on hand. I tested the press fit of a mini-WASP into the plate and it was as good as I could expect. Removal leaves no damage to the pins but when pressed on it has adequate hold power. With the top plates added I have a great surface to install the wire-wrap cabling. 


BUILDING THE POWER SUPPLY CONNECTOR

My first connector construction was for the simplest of the three modules, the Power Supply Module that needs only nine pins. I quickly put it together and moved the wires over from the temporary pins. I am pleased with the connector I have constructed and its operation.


BUILDING THE RELAY MODULE CONNECTOR

The Relay Module has space for 137 pins but for the purposes of this demonstration project I only need to install 75 of them.  They consists of three groups for different purposes:
  • 11 bring the 250 VAC 800 Hz power from the power supply
  • 20 are control inputs from the Arduino based driver to activate the relays
  • 44 deliver voltage to the segments of the EL panel