Bitluni builds a 20-cent USB GPU from a single microcontroller
Low-Level Hardware Experiment
Low-level hardware enthusiast creates the tiniest USB GPU with 20 cents of components - "high-res" text and low-res graphics with little more than a microcontroller.
Bitluni builds a 20-cent USB GPU from a single microcontroller - uses PWM tricks and SRAM caching for a 24x speed boost, outputs Rick Astley animations to a CRT TV. The ghetto RCA "jack" is particularly endearing.
YouTuber Bitluni is well known for his oddly endearing endeavors with low-level hardware work, and this time he chose a seemingly simple one: use no main components other than a small microcontroller to make a VGA "graphics card." This is a road he's traveled before, but now he wanted to make the card smaller still, opting for glorious monochrome video, with impressive results for only 20 cents' worth of components.
Choosing the CH570
In a previous VGA adventure, Bitluni used a CH32V003 RISC-V microcontroller, but found it a little too limiting for his taste. Browsing the spec sheet for its successor, the CH570, he was interested in the doubled RAM capacity and integrated USB connectivity, and even Bluetooth.
So he got to work, with the first step being leveraging a PWM signal to make an impromptu DAC. Those are weird words, so we'll explain.
A DAC, or digital-to-analog converter, is a part that takes a signal made of ones and zeros and converts it to voltage steps. They're everywhere, but the CH570 doesn't have one. However, you can leverage a PWM (pulse-width modulator), which flips on and off in rapid succession, as an approximation of voltage over time.
This sounds odd, but it does work, and it is also the principle behind modern Class D audio amplifiers used in hi-fi, PA, and instruments. Bitluni was satisfied with 16 shades of gray, down from the 50 others might aim for.
SRAM Caching for a 24x Speed Boost
The CH570 has a very limited amount of RAM, so getting a full frame of graphics in it would be too eager a challenge at first, so he elected to render text at half the possible vertical resolution.
This was extremely slow, though, until he realized that to properly leverage the CH570's speed, you need to put the code you intend to run into its SRAM cache first. After this fix, the picture generation ran 24x faster and enabled him to squeeze 34x37 characters.
With that working, he set to task recreating graphics, and after some more optimization work, he finally got Rick Astley dancing on screen, as tradition commands. The small animation was but a few frames long and in low resolution, but was very clearly recognizable.
Building the Physical Board
All this while, his development kit was connected to a tiny CRT television via its composite input, but now it was time to make actual physical gear. He designed a simple PCB with enough room for the CH570, along with a USB-C connector and a few assorted bits and bots.
The board cost him $15 for a pack of 10, and set about $0.20 worth of components on it, with the CH570 being the dearest at $0.13. The exceedingly tiny board worked quite well, even down to the improvised RCA barrel "jack" that was just a couple of grooves.
USB Connectivity
The final step was using USB for connectivity, as he wanted to use the connection as a serial bus via USB CDC. This took a few tries, because the now-enabled USB connectivity needed to be handled by the CH570's CPU, and the time slices needed for it were eating into the video signal.
After a few more optimization passes, Bitluni finally got the TV to display what he was typing. As an added bonus, he found that his development kit's jumper wire was acting as an impromptu VHF antenna and almost managed to lock the TV signal onto it.
About the Author
Get Tom's Hardware's best news and in-depth reviews, straight to your inbox. Download the Tom's Hardware app for up-to-the-minute updates on iOS and Android. Also follow Tom's Hardware on Google News, or add us as a preferred source, to get our latest news, analysis, & reviews in your feeds.
Bruno Ferreira is a contributing writer for Tom's Hardware. He has decades of experience with PC hardware and assorted sundries, alongside a career as a developer. He's obsessed with detail and has a tendency to ramble on the topics he loves. When not doing that, he's usually playing games, or at live music shows and festivals.
Comments
No comments yet. Start the discussion.