Bitluni builds a 20-cent USB GPU from a single microcontroller
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.
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.
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.
(Image credit: Bitluni @ Youtube) With that working, he set to task recreating graphics, and after some more optimization work, he finally got Rick Ast




Comments
No comments yet. Be the first to share your thoughts.