Me wearing ridiculous goggles


Racing the Beam

Glitch Internals Part 4

This post is the fourth in a series looking at the design and implementation of my Glitch demo and the m4vgalib code that powers it.

In part three we took a deep dive into the STM32F407’s internal architecture, and looked at how to sustain the high-bandwidth flow that we set up in part two.

Great, so we have pixels streaming from RAM at a predictable rate — but we don’t have enough RAM to hold an entire frame’s worth of 8-bit pixels! What to do?

Why, we generate the pixels as they’re needed, of course! But that’s easier said than done: generate them how, and from what?

In this article, I’ll take a look at m4vgalib’s answer to these questions: the rasterizer.


A Glitch in the Matrix

Glitch Internals Part 3

This post is the third in a series looking at the design and implementation of my Glitch demo and the m4vgalib code that powers it.

In part two, I showed a fast way to push pixels out of an STM32F407 by getting the DMA controller to run at top speed. I described the mode as follows:

It just runs full-tilt, restricted only by the speed of the “memory” [or memory-mapped peripheral] at either side…

But there’s a weakness in this approach, which can introduce jitter and hurt your video quality. I hinted at it in a footnote:

…and traffic on the AHB matrix, which is very important — I’ll come back to this.

Quite a bit of m4vgalib’s design is dedicated to coordinating matrix traffic, while imposing few restrictions on the application. In this article, with a minimum of movie puns, I’ll explain what that that means and how I achieved it.


Pushing Pixels

Glitch Internals Part 2

This post is the second in a series looking at the design and implementation of my Glitch demo and the m4vgalib code that powers it.

Updated 2015-06-10 — clarifications from reader feedback.

For the first technical part in the series, I’d like to start from the very end: getting the finished pixels out of the microprocessor and off to a display.

Why start from the end? Because it’s where I started in my initial experiments, and because my decisions here had significant effects on the shape of the rest of the system.


Introducing Glitch

A "Full-Stack" Demo

Hey, look! I made a little graphics demo!

I also wrote the graphics libraries it uses (m4vgalib), because that seemed like fun.

…and the music.

…and the music synthesizer that’s playing the music.

…and the music authoring tools for writing the music.

…and the C++ runtime library (ETL).

…and the build system (Cobble).

…oh, I built the computer it’s running on, too, based around an STM32F407.

My idea of “fun” is pretty odd, I realize. This is probably why I don’t get invited to a lot of cocktail parties.


Switching this site from Jekyll to Hakyll

I used to manage this site with Jekyll. I’ve now switched to Hakyll. Here’s my reasoning and some notes on how it went.


Project Loon

While I’ve been blogging about my personal projects off and on, I’ve been awfully quiet about my day job. Now I can tell you why.

The internet is an amazing technology for empowering people to connect with their loved ones, develop new ideas, find kindred spirits, start businesses, and educate one another. But it works best when everyone can participate.

Soon, they’ll be able to.

My Recommended Publicfile Patches

While djb is perhaps best known for writing qmail, he also wrote a web server, publicfile. Like his other software, publicfile is simple and robust. I use it to serve this site, among other software.

Characteristically for djb, publicfile is pretty minimal out of the box. Here are a few patches I applied to the source to make my server faster, more flexible, and easier to use.


Ultimate Guide to 3D Printing

Back in the Fall, I was invited to contribute to Make Magazine’s Ultimate Guide to 3D Printing. (That’s me on the front page, squinting at the Ultimaker wiki.)

If you’re in the market for a 3D printer, it’s a great place to start! We spent a weekend really putting these printers through their paces.

Attacks on my Server: The Data

I try to maintain a reasonably secure webserver.

A webserver is a computer, connected to the public internet, that does things (serves pages, etc.) whenever anyone asks it to. This makes it an easy thing to attack: the first step toward attacking a computer is usually getting it to do your bidding, and a webserver does your bidding every time you click a link.

My system logs show that I get attacked several times a day, like (I imagine) most computers on the Internet. Fortunately, most attacks bounce off — not because I have some magic security-foo, but rather because the software I’m using — specifically publicfile — doesn’t work the way the attackers expect it to.

While I am not so naive or foolish as to say that my server is “secure” — I’m sure it has some exploitable hole, and it runs in a distant facility that probably forgets to lock the doors sometimes — these attacks are of mostly academic interest.

Here’s some data I’ve collected from the past month or so of attacks. I figure this might help someone else detect or prevent an attack in the future.


Introducing swddude

I love the ARM Cortex-M series of microcontrollers. The sheer computational power they pack into a teensy, low-power package is almost embarrassing.

But, many Cortex-M parts are small — 4x4 millimeters small — and don’t have the pins left over for JTAG. For these parts, ARM introduced a new debug interface, called SWD.

Unfortunately, SWD isn’t well-supported by open-source tools. Support is in progress in most of them — including my personal favorite, OpenOCD — but I’ve had bad luck so far.

Anton Staaf was having the same issue, and decided to do something about it. He tricked the cheap, commonly-available FTDI FT232H chip into speaking the line-level SWD protocol. We’ve teamed up and, a week or so later, have something to show for it.

Presenting: swddude, the dead-simple programmer for SWD microcontrollers. (By “dead-simple” I mean “rather braindead” but it works!) Currently it can flash code onto the LPC111x, LPC11Cxx, and LPC13xx series. Support for more chips is in progress.

I’ve posted a mirror of the code on GitHub for your cloning pleasure. Happy hacking!

Being a Social Hacker

I may spend a lot of my time working on robots, but I like people. I’ve noticed this in my professional life: I’m happier and more productive working on a small team, rather than solo.

My day job has me working alone a lot of the time, so at the beginning of March, I decided to take matters into my own hands and “find the others.” I knew about Noisebridge in San Francisco, but they didn’t quite seem like my people — when I joined their IRC channel they suggested I jump in front of a train, in fact.

So I was delighted to discover a hackerspace right down the street from me: Ace Monster Toys in Oakland.


Making Thingiverse Faster

Thingiverse has deployed my modifications to Thingiviewer, which were first seen on this very site powering the 3D Thing Previews. The internet is now just a little bit better. Woot!

Fixing the Heated Build Platform's Bolts

I love my heated build platform. It’s the best upgrade my MakerBot has seen. No other change has improved my print quality and confidence to this degree.

But if you look at the pictures on that page, you’ll notice my least favorite feature: the bolts, or as I call them, the MakerBot Industries Amazing Nozzle Destroyers. Fortunately, there’s an easy fix.


Using PLA with the MakerBot Plastruder MK5

Polylactic Acid is a compostable plastic that can be made from renewable resources — usually plants. Compared to ABS plastic, it’s much harder, warps much less, and can be crystal clear. When I first got my hands on some PLA filament in 2009, it had the potential to be my new favorite plastic…but getting it working took time.


Implementing the Luhn Algorithm

In my previous professional life, I processed a lot of credit card numbers. When reading credit card numbers from an unknown source, it helps to have a fast way of checking basic validity — to filter out bogus input. Such a method exists: the Luhn algorithm. I developed a very fast implementation of the algorithm a few years ago, and I keep seeing it pop up other places.


Hello Blag!

It’s been over two years since I last posted anything substantive on the net.


More Cliffle

By Topic