I'm probably going to reveal my age here, and annoy a few readers by asking who else, other than myself, remembers a but of a novelty media form factor from some years ago, called HitClips?
Ooph. The folks at the Museum of Obsolete Media certainly seem to remember. I didn't think they were that bad, but I was also somewhere around 11 -12 years old, so my standards may have been subjectively lower at the time...
Yeah, okay, I remember how awful the '00s were now. '90s with a good infusion of the great WWW. But, as a kid, this sort of novelty tech was really something else!
While these days we are spoiled with streaming services galore on our high-speed smartphones, we're harking back to the days where MP3 players were still the de facto way to get your music on the move.
I could mow lawns all summer, but an iPod was always out of my price range — Hit Clips were a bit more on the affordable, if awful, side of things...
In a nutshell, the player device in the HitClip ecosystem was really more a battery pack, and a small, basic audio amplifier. That's it. No brains, no microcontroller, just that.
That leads us to looking at the HitClip modules themselves, where the magic really happens.
More than just a mere blob of flash, the HitClip module contains not only the "memory" required for a miniscule audio sample, but also some form of ASIC that will toggle a few pins in response to the audio memory, resulting in a bitstream representation of the audio data, used to drive the amplifier contained with in the HitClip player device.
We have "memory" in quotation marks, as there is a great observation from ch00ftech, in their absolutely awesome write-up on reverse engineering the media format, that mass production of these devices would likely see the audio data etched directly into whatever wire-bonded ASIC device lives under the black epoxy blob in the HitClip cartridge.
With the work from ch00ftech serving as a sublime starting point into secrets in how the HitClips worked, we now turn our eyes to the work of Guy Dupont, who teased us on Twitter with his recent efforts to retrofit his own homebrew hardware into a HitClips music module, with results that far, far exceed not only the capacity, but the fidelityof the original form factor!
While starting out with ideas based around the venerable and still very usable 8-bit ATtiny84 from Microchip, Dupont quickly found himself running up against the limitations imposed by the slower clock speed and small amounts of RAM found in the ATtiny — when compared to a more recent MCU such as the ATSAMD09C, again, from Microchip, which sits in the same footprint, using the same external components, but unfortunately is not pin compatible. So close.
But for the sake of reworking a few pins in the netlist and tracking, we'd say that the upgrade to the SAM D09 is certainly worth the effort. The jump in capability from moving on up to a 32-bit Cortex-M0+ is one thing, but you more than just a newer, more capable processor.
A few very nice things to have include the ability to write directly to the entire, unprotected address space of the flash memory of the device, and one of my favorite helping hands to have; DMA — which lets you connect peripherals to act automatically, and muchmore quickly than relying on the host processor to step in and sort it all out. With access to nearly all of the chip internals, It's entirely possible in some cases to replace an a whole application with nothing but DMA descriptors (the definitions for "what, where and when" that DMA will use).
DMA lets you trigger/initiate memory transfers from FLASH to most peripherals, and back again, or even from peripheral to peripheral in some cases — very handy for applications with lots of data (e.g. audio).
With a capable MCU in hand, Dupont has pretty much all he needs to already to spit out the Sigma-Delta bitstream, to be used to drive the H-bridge amplifier that will be sat inside the player device.
However, as generous as 8KB of is for such a small MCU, there are more attractive options out there for mass storage solutions, such as the ubiquitous µSD cards that we all have sat about.
It doesn't take much to set one of these massive capacity memory cards up as a SPI flash device, thanks to some handy abstraction libraries — in this case, the Petit FAT File System library, from the legendary elm-chan — that take care of all of the file system and SPI transport heavy lifting.
If you pair up a uSD card with a the aforementioned SAM D09, well, you get a pretty pokey, postage-stamp sized audio player — the perfect size for packing into a HitClip of your own curation!
There isn't much more to this module than meets the eye — the memory card, MCU, and two other ICs, which we see detailed in the schematic below.
The PWM Router is worth mapping out in terms of function, as it seems a bit odd if you haven't gone and read that reverse engineering writeup from ch00ftech we mentioned earlier.
The original HitClip hardware would directly drive the push-pull FET pair found in a D-Class amplifier, seen below in the middle of the diagram in the block marked "Switching controller and output stage."
It'd be nice to be able to do this with a single PWM channel, and that is what the "PWM Router" block in the schematic does.
AKA, a SN74LVC1G139 2-Line-to-4-Line Decoder, we can look at the internal logic to map out what's going on with the bitstream.
If we apply the circuit net names to the inputs, and take a look at the truth table, it begins to become a bit clearer!
We can see that the incoming PWM signal is mapped to either the Y1 or Y3 output, and that the signal is going to be inverted with respect to the polarity of the incoming PWM.
I can hear some people saying "ok, cool, but why not just do it with the really capable MCU already here?"...
Sometimes a hardware solution is easier than tying up two PWM timer outputs, and even easier than trying to de-interlace a bitstream in memory to two different peripherals...
Not content with cramming his new hardware into the constraints of the previous generation of HitClip casings, Dupont took to the screens of OpenSCAD (+1 for one of my favorite CAD tools!) to script (yes, script) up an enclosure for the board we've seen above.
OpenSCAD is amazing. It's a scriptable CAD language that allows you to programmatically generate geometry based on parameterized values.
Here's a snippet of the 69 line script that created the above 3D model.
See the block at the top? Here you can tweak things like PCB thickeness and width, or even variability for package heights in components. That's awfully application specific, but the concept is hugely powerful, and even can be extended to a scriptable animation engine, like the OrangeCrab (🍊🦀!) example below.
While scripted CAD might not be that intuitive at first, from parametrized PCB enclosures, to ECAD animations, OpenSCAD is awfully powerful and certainly a tool to keep in mind for future projects.
With the PCB and case design taken care of, all that was left was to get a perfectly polished printed part order placed with PCBWay, for their UTR-8100 print service.
While it's a little hard to make out the optical clarity of this print option, we've seen it before in custom casework, and the results really are stunning.
The "GlassBoy" from Gunnar (@GmanModz) on Twitter is just glorious, and certainly lives up to its name.
It's no wonder Dupont chose to go for this option here, showcasing the atom-sized album art is part of the appeal of the HitClip cartridge, so going for an optically clear finish is a no-brainer!
Get the rest of the gory details from Dupont here in this video he's published on the project!
For those still wanting to immerse themselves in further details, you're in for a treat. We've got links to a GitHub repo, a Hackaday project page, and of course, Twitter for the birds amongst us — @gvy_dvpont.