Musings of a Fondue

Phone Repair: Part 1 - Power Button

I dropped my phone one too many times. This time the screen gave in and shattered.1 Whether related or not, my power button soon failed after and my phone was unable to boot. It would get about a second into the boot process before restarting again, as if the power button was constantly being pressed. The behaviour was the same even in recovery mode indicating that it was likely a hardware rather than software problem.

A Google search revealed that failure of the power button is a common problem with the Nexus 5. I tried the easy solution of partially disassembling the phone to get at the button and clean it, its rubber pad, and the surrounding area with isopropyl alcohol. Unsurprisingly, it didn’t work.

In my search, I came across this awesome article by Gregor van Egdom. It has a great explanation and photos of how this particular button works and why it likely fails. His solution is to replace the button. So I went ahead and ordered a replacement from Ebay ($5 with shipping from the US (I could have gotten it cheaper but I wanted it now rather than later as my phone was unusable)).

James Molloy OS Tutorial

I wanted to get my feet wet with regards to writing operating systems from the ground up. I came across this awesome tutorial by James Molloy. In it, he walks through the creation of an ultra minimal unix-like operating system.

— Setup —

Setting up my environment took quite a bit of time. The setup instructions are aimed at a Linux/macOS environment whereas I am running Windows. Luckily, Windows Subsystem for Linux (WSL) is a thing and I was able to continue along. However, there was a catch - WSL does not have a graphical user interface (GUI).1 This meant I could not use Bochs (the emulator used in the setup instructions).2

Intel 8080 Emulator

I started down this journey a bit randomly. I was researching how the Game Boy uses memory bank switching when I came across this video1 in which the author attempts to emulate the Game Boy. Since the Game Boy’s CPU is a hybrid of the Intel 8080 and Zilog Z80 processors, they start out by implementing the 8080’s instructions. Though my initial intent was to learn about memory bank switching, seeing this inspired me to set off and create an 8080 emulator.

I lucked out in my choice to emulate the 8080. It turns out that retro CPUs are orders of magnitude simpler to understand than modern ones and that the 8080 is one of the earliest. As a byproduct of this simplicity, their documentation are detailed while remaining reasonable in size (i.e. readable). (Contrast the less than 300 pages of the 8080 User’s Manual with the almost 5000 pages of Intel’s current 64 and IA-32 Developer’s Manual!)

FFmpeg Snippets

Scripts for useful FFmpeg actions. Posting for future reference. Perhaps others will also get use from them.

Games for the Computer

I hope to run some of the games for the PICO-8 fantasy console on my Homebrew Computer. For example,


The developers have spent a lot of time writing the code, designing the graphics and gameplay, and creating the music to make the games beautiful and fun. While they are not as CPU/GPU intensive as your typical AAA titles, it would be quite an achievement if my computer can run them at a decent frame rate!

A VHDL Take on Ben Eater’s CPU

IMG_20170903_132332

As part of the Homebrew Computer Project, I have been exploring other CPU architectures and their implementations in order to broaden my understanding of CPU design.

An awesome one that I came across was Ben Eater’s 8-bit computer. It is well documented through a series of videos on Youtube and also on his blog. The architecture is simple which allows you to get a firm understanding of all its components.

Since it is a known working design, I saw it as the perfect opportunity to practice implementing a CPU in VHDL.

LCD Woes - Back With a Vengeance

After months of waiting the new LCD assembly finally arrived!

I noticed the PCB had a different layout than the one I had earlier. Gone was the onboard voltage regulator. Yay cost cutting! Also missing was the ZIF connector. In this one, the LCD flex cable was soldered directly onto the PCB, yay more cost cutting! Given the trouble I had earlier trying to resolder the four chunky traces of the touch screen cable, prospects looked dim for resoldering the many small traces of the LCD screen cable. Drilling mounting holes onto the PCB no longer looked like an option.

Before doing anything, I checked whether the LCD works. I connected it to an Arduino and loaded Adafruit’s graphics test. It sort of worked. But not quite. The screen flickered and what rendered looked glitchy. See the video* below for what I mean. Contrast this with what the test is supposed to look like.

Not quite right

LCD Woes

IMG_20170501_153234

It was time to put the previously disassembled LCD assembly back together. Reconnecting the LCD to the PCB was easy enough (given that it was a ZIF connector). However reconnecting the touch screen would prove to be my undoing.