Adding in serial link to drive external EL panel
The Arduino Mega has four serial ports, one carried over the USB cable but three more that can be accessed by the software and pins on the board. I chose Serial1, using pins 18 and 19. Now I have to add code to command the EL panel built by Ben Krasnow (Applied Science YouTube channel) to have it mirror the output of my own.
I haven't written or debugged the code to drive his board, something I will defer until next week. My first priority is getting the DSKY complete and fully tested in advance of wiring it up to the Apollo Guidance Computer.
Activating EL wire in my display
My display uses electroluminescent wire for the three horizontal green lines on the display that separate the outputs for registers 1, 2 and 3 from the upper displays. These wires require high voltage AC, which is generated by a driver module inside the acrylic base. The driver is switched on and off by a relay board.
The driver should only be on when the BPLUSSW (14V switched power) from the AGC is present. The AGC can be in standby mode, with no power on BPLUSSW, which causes the panel on the DSKY to blank out.
I have been sensing the BPLUSSW using a voltage divider on my PCB that produces a 5V signal when the computer is not in standby. This seemed like a perfect source for the drive to fire my relay board, however the Arduino has an input pin connected as well. The result is that the Arduino drags the voltage way too low because of how the resistances of my divider and the Arduino input are set.
The Arduino gets the signal because the driver on my PCB that lights up the legends under Verb, Noun and Program requires a ground level to turn on. Thus it is logically inverted compared to the output of my voltage divider - when no BPLUSSW, I light the legends and when the computer comes out of standby, I extinguish them.
I had to put in an inversion in the Arduino code and drive another output pin, so that when BPLUSSW is on, the output pin is pulled to ground and causes my legends to light. I now have to set up another output pin that is not inverted but mirrors the BPLUSSW voltage divider, since my EL wire driver board relay needs +5 to activate, not ground.
I do have spare pins on the Arduino Mega 2560, although they are not connected to headers on my PCB. I can insert a discrete wire (carefully) into the chosen pin and route that to my EL driver relay board. A quick update to the Arduino code and it was ready for testing.
Soldering the external female connector pins to the PCB wiring
The task of soldering my 'inside' connections - short cables that run from the header jacks on my PCB down into the acrylic base where they get connected to the solder lugs of the female 85 pin Bendix connector - was tedious and made slower by the constant double checking to be sure everything is right.
Completing the cable on the external male connector
Once I had all the wires extended the soldered joints needed to be covered with shrink wrap and then the entire cable wrapped in electrical tape to make for a neater wiring harness. As part of this job I tested all the connections through to the inside connectors where they would plug into the PCB, to be sure I had a solid set of circuits.
Each external wire was hooked to a continuity tester and I located the PCB connector where it terminated, then stuck on a label with the signal associated with the wire. Repeat 34 more times and I had all the signals and power lines identified and verified, ready for testing.
SETTING UP TESTING RIG
Testing the DSKY replica is complicated by the odd voltages used. My PCB and some minor boards are driven by the usual 5V DC, but we also have to provide 14V and 28V for testing. The AGC signals coming into the DSKY swing between 28V and ground. The computer as a 14V supply that is turned off when the AGC is in standby, thus we have to take the switched 14V into the DSKY as a sense input.
Incoming signals work by having 28V fed through my PCB interface circuits and the input pin pulled to ground to activate the signal (inverted logic). Outgoing signals pulls their output pin down to ground when activated (also inverted logic). Fortunately, I can feed whatever voltage I want on the output pins, so I chose to use pullup resistors on the tester side.
My 23 inputs to the DSKY are handling 28V, so I made use of banks of relays that will pull the signal to ground through a 2K resistor when the relay is activated. The relay trigger circuit is fired by the Arduino which I use for the test driver. The 8 outputs of the DSKY are hooked to input pins on the Arduino set with internal pullup. I use the serial link over USB to a computer to control the test and read results, in addition to observing the DSKY behavior.
I didn't have enough 2K resistors for the setup today - five 2K and 7 2.2K were all I could scrounge up - but I can test a fair amount of the DSKY with that, stepwise. As long as the codes for the digits don't have more than eight total ones out of the ten bits to be set in a relay command word, I have enough resistors. I can do a more complete test later this week when I get more resistors.
TESTING THE DSKY
My series of tests:
- Power up 5V, nothing should show
- add 28V, nothing should change
- Add 14V, the legends (Verb, Noun, Prog) and the three lines should light
- Seven of the fourteen lights have discrete lines to trip them, toggle each
- Key Rel
- Uplink Acty
- Opr Err
- Comp Acty
- set up the register value (M12-M15) for lights and toggle each of the next eight
- No DAP
- No Att
- Gimbal Lock
- Prio Disp
- With some of the lights lit, turn off 14V, verify they remain on, then turn on
- Set up register value and toggle signs
- Set digits in Prog display
- Set digits in Verb display
- Set digits in Noun display
- drop 14, verify they turn off, turn 14 on, verify they are blank
- Set up Verb, Noun and Prog, then turn on VNflash and observe
- Oscillate VNflash
- set digits in registers
- verify split register changes both R characters
- flash key rel light
- verify Pro key detected
- verify keypress release works (on while key is depressed)
- verify reset key discrete
- verify all key codes sent
I ran through the tests and at step 3, I wasn't getting the electroluminescent wires lighting to switch on. That was because of the funky way I was inserting the newly added wire that drives the EL driver board relay - it kept popping out.
After I found a way to secure those wires down inside the headers on the Arduino but then discovered that the Arduino and the relay activation were cycling - as the relay flipped on due to presence of 14V signal, the driver pulled so much power that the Arduino reset. I realized I need a humongous filter capacitor to support the surge as the EL driver turns on. That fixed the behavior.
I modified the DSKY firmware to emit diagnostic information over the serial port. I will be able to see whether the input is ever checked and if it is detected. I saw that when I pulled down the Oper Error input, it was properly detected. The Caution/Warning lights illuminated too, thus this part of the test is good.
The COMP ACTY light did not illuminate with the 14V missing, which is correct. I then hooked up the 14V to the sense line to verify that when unblanked all will work well. The other lights behave in a way consistent with the real spacecraft.
Six of them are lit or dropped based on a discrete signal coming from the AGC, so they will turn off as soon as the AGC goes into standby. Eight of them are relays inside the DSKY that are only set or reset by writing to register bank 12 with specific bits on or off. If they were lit, they remain lit while the computer is in standby and don't turn off into the software writes to turn them off as part of coming out of standby.
Next up I tried to test the signs, which are turned on or off by writing a specific pattern to various register banks. I set up the wiring but I didn't see the sign words light. It was time to do some diagnostic output from inside my firmware and figure this out.
DESIGNING INTERFACE PATCH PANEL FOR AGC
The AGC communicates with the rest of the spacecraft (and the DSKY) through a 360 pin connector (A51). There are four main types of interface circuits for sending and receiving discrete digital signals and for sending and receiving pulses.
The spacecraft systems mostly operate with discrete digital signals which are 28V when logic high and near ground when logic low. Pulse circuits use approximately 10V for the on state of the pulse. My panel will convert those voltages down to levels that can be wired to TTL or LVCMOS digital devices.
The panel will be constructed as ground support equipment, fitting in two racks side by side. Each side implements half of the A51 connector signals; the connector is six rows of 30 pins, a break and 30 pins. Thus, one side will have six rows by thirty columns of receptacles for the patch cables.
The cables use 4mm banana plugs on both end. Above the rack panel with the 6 x 30 connectors hooked to A51 will be five sets of interface circuits, each with 26 interface circuits (8 type C, 7 type D, 6 type XT and 5 type Y).