Freak HW: almost ready for testing
Updated: Jun 18, 2019
Over the past months I have been working on the Freak firmware. The progress has been slow since I had other tasks, like the update of my modules for VCV Rack 1.0 and the upcoming modules for Voltage Modular.
One of the things that was taking me a lot of time was the design of the graphics that are gonna be used in Freak.
Freak has a small screen of 128x32 pixels that is gonna be used to display the current configuration and the menus. Since I don't like to rely on other people's code (except in special situations) I decided to write my own code to control and draw the screen. It was a tedious process, but very interesting. I wrote a small library to write sprites. This library inspired by the work that once I did for the GameBoy.
Every image needs to be encoded in a certain way so it's fast to write into the frame buffer. I was looking for tools to help me do that but I couldn't find anything that fit my needs. Again, I decided to write mine. Rather than making a pixel drawing tool, I use Affinity Designer to create the graphics and then I use program written in Wolfram Language (Mathematica) to convert it to a C++ array. This program performs the whole process of reading the image, adapt it for black and white and generate the numbers in the expected encoding.
Using the same program I was able to design a font that I could use to draw text on my screen. I downloaded two fronts with a public domain license and converted them to sprites. The fonts I used are: Press Start 2P by CodeMan38 and Electronic Highway Sign by Ash Pikachu Font. These two fonts look really nice in the small screen.
Designing the screens was taking me a long time. I have to admit that I was using a very silly method to draw the text. I was guessing a position, then compiling the code, uploading the firmware and checking the result. If the text does not look right, I would repeat the process. To make it in a more efficient way, I started using a simulated screen made in Affinity Designer. That way I could prototype the screen, make all necessary adjustments and then write the code.
I also wrote a VCV Rack module that simulates the screen.
Once I had the graphics controlled, I had to focus on a very important task: developing a simple way of updating the firmware of the module.
Initially I thought about adding some extra hardware to the module to allow connecting it to the computer and perform an update through the USB. I discarded that idea because adding that extra hardware would have increase the cost of the module. Additionally, this method can create more problems for the user due to the special requirements on each OS. At the end I decided to got for the WAV file update method. For this I adapted the code from Emilie (formerly known as Olivier) Gillet. This method is easy for the user since no special equipment (just a cable and sound card) is required.This method works very well.
Even when I don't like to use other people's code, in this case I made an exception. Emilie's code has a good license (MIT) and the code has a good reputation. It does solve my problem without creating additional issues.
I created a full video showing how the update process works.
I'm making progress. I'm gonna build some of the test units in the following days and I to start shipping them to the testers very soon.