New month, new projects... having failed to get anywhere with my computer game idea, and having pretty much completed all I need to do for The Right Notes, I've been looking for a new project. Covid-19 is still keeping most of us in our homes, my social life has dwindled to the occasional walk with a friend at the weekend, and I'm not supposed to visit my parents as we live in different tiers in Scotland just now.
If I was sensible, a new project would be something manual and useful - a friend has taken up knitting, for instance - but instead I've gone down the programming route again and bought myself a Raspberry Pi. For about £50 I've got a remarkably powerful computer with the footprint of a credit card. I've bought a couple of things to plug into it - blinking LEDs and the like - and an ePaper display. I've had a few little projects on the go.
ARM Assembly
I thought I'd try my hand at learning the basics of Assembly language programming. It's really hard going, and I've struggled to find suitable training materials. Eventually I bought a book (Raspberry Pi Assembly Language, Bruce Smith and worked my way though most of the chapters. Enough to know that I'll never write much in Assembly.
Blinking Lights
I've had quite a bit of fun with the MonkMakes Pi Project Box, wiring up lights and buzzers and sensors to the Pi via a breadboard. I doubt I'll do much more with this, but it was a nice diversion into hardware. The corresponding software is written in Python, unfortunately, a language I have no interest in learning at all.
I'd like to recreate some of the examples in a different language, ideally Kotlin or Java. For that, I need a library for the JVM which can interface with the GPIO pins on the Pi. The leading Java library, Pi4J, is going through a big rewrite just now, and I couldn't get either my own code or the example code working at all. It needs an underlying C library, and the leading candidate for that, WiringPi, has shut down development. Neither WiringPi nor Pi4J promise to support the Raspberry Pi 4B, the latest model and the one I bought.
It seems now is not the right time to be learning to program the Pi in anything other than Python or C.
ePaper Display
Talking of programming in C, I've also been experimenting with an e-Ink display 'HAT' for the Pi, a 3-colour, 2.7inch model from Waveshare. It's a funky, fun thing, with a dreadful refresh rate. It takes about 15 seconds to redraw the screen. Project one was going to be a little clock, but if a quarter of every minute is spent re-drawing the screen, it would a rather annoying clock. The 2-colour model (B/W, rather than B/W/Red) has a mere 6-second refresh time, and larger screens seem to be faster still.
It's enough to get going though, and I have written that little clock in C. I haven't written any C code since my early days at university (which is depressingly more than twenty years ago). That's been quite a learning curve. C isn't a complicated language, but relearning when to use pointers, and when deference them, has been hard work.
I might keep going with C, but I think I'd still rather stick to a language I know well, like Java or Kotlin. I've got some ideas using Kotlin Native to compile Kotlin code down to ARM assembly (rather than Java bytecode), but that's for another post.
Retro RISC OS
I have watched a lot of videos on YouTube about "retro computing" (and I mean a lot). There are some fascinating histories of the early 8-bit home computing market, when there were a dozen different options for the middle classes of the UK and USA. The Commodore 64, the Apple ][, The Sinclair ZX81 and Spectrum, the BBC B... It must have been exciting times. I've been struck at how pervasive the processors used in these early machines were - the 6502, the Zilog Z80, and others were used for years, almost decades. Successful generations of computers weren't faster, as they had the same processor, but they were generally more powerful and versatile as graphics and sound processors picked up the workload.
My first computer was a slightly dysfunctional Sinclair Spectrum +2A. Many commercial games didn't seem to load; I found myself typing Spectrum Basic code from magazines more often than playing games. My second was an Acorn Archimedes A3010. The Archimedes range, running 32-bit RISC OS, was popular in British high schools for a period in the mid 1990s, and it was powered by an ARM250 processor - one of the earliest in the long line of ARM processors which now power every mobile phone and, usefully, my new Raspberry Pi 4B.
So I've installed RISC OS 5.28 on an SD-Card and can run it on the Raspberry Pi. Neat, nostalgic, and not at all working because I don't have a wired USB keyboard to plug into it :). Still, a project for another day.
New domain
I've been moving this website to a different domain name - www.liamjd.org - and switched hosts too. I wanted to secure the website, and I wanted to move away from .co.uk. I'll be setting up a redirect from the old domain soon.