Close

Software Improvements

A project log for DSKY

Create a working DSKY using a 3D printer and my AGC simulator running on a Raspberry Pi and slave Arduino Nanos.

wglasfordwglasford 07/15/2022 at 15:180 Comments

The first improvement is to simplify the indicator commands between the Pi and the Arduino.  Instead of splitting out the channel 11 and channel 10, relay word 12 writes into separate commands on the Pi, I modified the interface to send a single command each to the Arduino and let the Arduino sort it out.  Here is the following new command structure.  The Display and Other indicators command send the command followed by a number.  Ex: "3 20" is used to light the ALT and PROG indicators.

0    Noop

1     Reset to power on state

2    Identify

3    Display Indicators:

          NO ATT : bit 0

          GIMBAL LOCK : bit 1

          PROG : bit 2

          TRACKER : bit 3

          ALT : bit 4

          VEL : bit 5

4    Other Indicators:

          UPLINK ACTY : bit 0

          KEY REL : bit 1

          OPR ERR : bit 2

          TEMP : bit 3

          STBY : bit 4

          RESTART : bit 5

I always seem to do my best thinking at night when I am asleep.  Woke up this morning and realized that checking for a clock pulse on the clock line is not a good way to check for the presence of hardware since the hardware can be in debug mode and you can stop the clock, step the clock or not even have the hardware running yet.  A better way to do this is to use one of the unused hardware pins as a H/W Present pin.  I will configure that pin on the Raspberry Pi with the internal pull-up resistor.  If the hardware is connected, it will pull that pin low signaling the presence of hardware.  I have also decided to have my hardware simulator run external to the DSKY, thereby simulating the hardware through its 26 pin connector.  This means I will modify the way the Raspberry Pi starts up.  By default there will be no arg, an arg will only be used if you wish to run the internal test.  The software will check the H/W Present pin and if low take inputs from the 26 pin connector, if high it will connect to the internal software simulator.

The interface to the Display Arduino has been modified to simplify this interface as well, pushing the decode logic to the Arduino.  Here is the new command structure.

0    Noop

1     Reset to power on state

2    Identify

3    Display command

4    COMP ACTY indicator

5    Flash Verb/Noun

The display command takes the 15-bit Channel 10 values, all except relay word = 12 which is routed to the Indicator Arduino.

I also simplified the program interface.  If no argument is supplied, the internal software simulator is used.  If "--TEST" is supplied then the internal test is executed.  In the near future the software will check one of the GPIO pins for a H/W Present signal which will cause the code to interface with the 26-pin connector.  Either the hardware AGC or hardware simulator will connect to this pin.

Discussions