The aim of this project was to emulate the Apollo Guidance Computer (AGC) and DSKY user interface on a handheld physical device running the machine code from the Apollo lunar missions (tested with Luminary099, the software that ran in the Apollo 11 LM). This involved designing custom PCBs (finished in stylish lunar white) featuring:

  • STM32F072RBT6 48MHz microcontroller.
  • Micro USB socket for power (draws less than 500mA, so USB 2.0 compatible) and flashing the microcontroller using DFU.
  • SWD interface for programming and debugging.
  • WS2812B single-wire digital LEDs.
  • MPU9250 IMU (not yet integrated into the Apollo emulator).
  • Multiplexed keypad and 7-segment displays.
  • UART port for further expansion.

Apollo AGC/DSKY emulator DSKY lamp test routine on the right, my own hardware test program on the left (showing accelerometer x,y,z acceleration register contents)

Unpopulated PCBs Unpopulated PCBs

The firmware is built upon the vast body of work done by the VirtualAGC project. As well as transcribing many of the original Apollo schematics and software printouts into digital form, the project has produced the yaAGC emulator, a desktop C application that emulates the AGC, and yaYUL, an Apollo assembler. My project took the binary ‘core rope’ output of yaYUL, rearranging some memory banks before storing it in the STM32’s flash memory. A ported version of yaAGC running on the microcontroller could then step through the instructions in the Apollo binary. My code maps yaAGC’s I/O channels to the physical hardware on the board.

Running the lamp test routine

Note: This project would not have been possible without the work of Ron Burkey and everyone else involved with the VirtualAGC project (and of course the people who designed the original at the Charles Stark Draper Laboratory and NASA). Take a look at their work here: www.ibiblio.org/apollo/index.html

Todo list:

  • Use a faster processor or optimise the code. Unfortunately, the STM32F072RBT6 appears to be too slow to run the emulator in real time. For example, when viewing the ‘mission’ time, the second counter increments at less than one second per second.
  • Use DFU to communicate with LEDs, rather than pausing the emulator.
  • Include option to feed IMU data into the emulator.
  • Communicate with a spaceflight simulator such as NASSP over USB. The end result of this would be to use the handheld emulator to land on the moon…