This is my Raspberry Pi ZeroW with home-made neo-pixel HAT; constructed using M3 nuts and bolts, and a lollypop stick. Note the use of jumper shunts for discrete pin connections. The neo-pixel strips are arranged in two rows but are wired in sequence. They provide address and data indicators for my 8-bit Intel 8080 simulator influenced by the 1960’s Altair 8800 computer.

I am indebted to Luca who showed me his Digirule2 from bradsprojects at one of our Stafford Pi Jams. I bought one and then decided to see if I could put a similar 8-bit binary computer simulation on the BBC micro:bit. 

I could and I did and I was so pleased with the result that I decided to sign up to github and share my project.

Because I had chosen to use microPython to write the simulator, I thought I would try to port it to Python on the Raspberry Pi. I wanted to keep the project headless and use a minimum of GPIO connections so I ran a 16 led display as a neopixel strip using D18, 5v and ground, and had 20 input switches by using an infrared remote receiver on D24, 3v and ground. It took a lot of work, including a full system upgrade to Raspbian Buster, to get the infrared working with Python and even then the results were not very reliable. I was able to get far more robust responses when I ported the project to a NodeMCU ESP8266 board running microPython: instead of neopixels I used an OLED screen for the display, which allowed me to add extra options and a help menu. By this point, I was porting the simulator to every platform that supported Python: I ran it on Win10 using Python 3 and the Tkinter GUI, and I ran it on my iPhone using the wonderful Pythonista app. A fuller account of my experiments can be found on my website.

I particularly enjoyed working with different base notations. The Digirule uses binary layout for input and feedback. On the micro:bit I used binary but organised the bits in hexadecimal blocks and provided a binary to hexadecimal convertor. For the IR controller models I utilised octal input as featured in the code examples of the original Altair handbook. Octal translates easily into 3 bit blocks and can be nicely handled by a numeric keypad.

Eventually I came back to the Raspberry Pi to use a Tkinter GUI program with mirrored output on the neopixel HAT. I am running this from the Win10 laptop using Putty to ssh into the Pi and an Xming server to display the Tkinter GUI.

If you enjoy running the Pi headless over ssh then consider installing tmux. This ‘terminal multiplexer’  not only allows you to split windows or create extra panes but remains active if the connection is lost; allowing you to log back on and carry on coding.

Share This Post

Share on facebook
Share on linkedin
Share on twitter
Share on email

Leave a Reply