This weekly debrief is for paying supporters of my work. Please only read if you’ve paid. Thanks!
→ Click here if you've paid ←
Last week I chipped away at my plans for bedrock-micro, a Bedrock implementation that will run on a tiny microcontroller, and this week I’ve been working on the Bedrock Public Library.
bedrock-micro
Designing the device bus
The most important piece of the design that I figured out was how the device bus is going to work. The microcontroller I’m working with only has six I/O pins, with four already being used to talk with the memory chip via SPI (a clock pin, an input pin, an output pin, and a chip select pin). That left me with two pins to somehow read and write from sixteen separate devices.
The solution was to also use SPI for the device bus, reusing the same clock, input, and output pins that the memory chip is already using. One of the two remaining I/O pins can then be used as a chip select pin for the device bus.
Finally, I need to be able to select an individual device on the bus to talk to, which I can do using two logic chips and the final I/O pin. The microcontroller can use that final pin to pulse a four-bit device address into a serial-in parallel-out shift register chip (the 74HC164), which is wired to the inputs of a 4-to-16 multiplexer chip (the 74HC154), and the sixteen outputs of that are then wired to the chip select lines of each of the sixteen devices. Easy peasy.
The benefits of using SPI as a protocol to talk to the devices is that it’s fairly robust compared to something like I2C. It’ll be possible to hand-test the different device circuits by manually clocking bits into and out of them with a couple of switches, instead of having to set up a computer to do it all for you.
A handful of components
The list of components needed to build this computer is going to be tiny. Other than the microcontroller, the circuit will need a memory chip, two logic chips for the device bus, a handful of header pins for devices to connect to, and a voltage regulator chip with three capacitors in order to support a wide range of input voltages (to run off various batteries or USB power or whatever is on hand). All up, that’s probably about $15 NZD to build a computer from scratch.
I’ve written up the plans on the bedrock-micro page if you want to read more about the design, it goes into more of the details.
Going forward
I’ve got the circuit design figured out and I’ve written up most of the firmware for the microcontroller, but I don’t think I’ll spend any more time on this project for at least the next few months. The next stages are going to be very labour intensive, it’s going to take a bit of time to order the components and solder up the circuit, and then it’s going to be an absolute pain to debug because I can’t look inside the microcontroller while it’s running.
I’m eager to see Bedrock programs running on such a simple computer, but I think it’ll be a better use of my time for now to focus on things that are more central to Bedrock as a whole. Things like a better user manual, and tooling, and the Bedrock Public Library, and just writing more libraries and programs that I can run on these implementations.
Bedrock Public library
A new look
I finally got around to coming up with the overall aesthetic of the website, the fonts and the colours and all that. I wanted to find a look that comes across as playful and fun but that also looks like something that you can do real work with. Something competent and well-made, but that doesn’t take itself too seriously, without being juvenile or gaudy. I’m really happy with the colours I settled on, yellow/orange/blue on cream.

The back end
I also sank a bunch of time into the design of the API and the database schema, trying to figure out how to implement all of the features that I want. It’s difficult to list all of the changes that have been done here, it’ll probably be easier to show everything off once I’ve finished.
Thanks
That’s probably enough for today. Thanks for following along with my work, I’m looking forward to sharing some more progress on all of this. Have a wonderful week!