YouTuber bitluni’s newest unimaginable construct video makes use of a RISC-V microcontroller with an unusual driving method to create a modular Magnetic LED Matrix.
The LED matrix is an off-the-shelf 8×8 module. Bitluni designed a customized PCB to hook up with the matrix. It accommodates a WCH-IC CH32V208 RISC-V microcontroller and a number of eight-channel drivers for the LED matrix. A 3D-printed enclosure creates an entire module. Bitluni glued magnets into the sides of the enclosure so they may snap collectively. Pogo-pin connectors (pins on one module, pads on the opposite) move energy and communication.
PCB with LED driver rework (📷: bitluni)
Bitluni is not any stranger to the WCH-IC CH32V RISC-V microcontroller collection. In a previous mission, he created a 256-core RISC-V supercluster. Whereas the WCH CH32V208 on this mission does have wi-fi functionality, bitluni selected this one due to the excessive variety of GPIO pins out there. Driving the matrix on a single module immediately would require 32 IO pins since there are eight rows and eight columns with three pins for RGB colours. (So, eight rows by 32 columns.) Nevertheless, bitluni just isn’t driving the matrix immediately.
The matrix rows use an built-in high-side driver with eight channels, and the columns use three eight-channel low-side drivers to cowl the 24 I/O required for eight RGB LEDs. With this setup, the show might obtain as much as 400,000 frames per second (FPS) with 1-bit or 133K FPS with two-bit coloration depth utilizing a standard Pulse Width Modulation (PWM) method. Nevertheless, this method means the CPU drives the GPIOs 100% of the time, leaving no spare cycles for something enjoyable.
Binary Code Modulation to “save time” (📷: bitluni)
Bitluni’s last implementation is what he calls “divide and conquer” however is also called Binary Code Modulation (BCM). BCM is just like PWM. Nevertheless, BCM depends on interrupts to offer the delays between bit adjustments. The burden of the binary values determines the time between interrupts, and the variety of interrupts is expounded to the bit-width. For instance, to realize an eight-bit coloration depth, there can be eight interrupts. Throughout every interrupt, an interrupt service routine (ISR) pulls the present bit’s place from a rotating buffer to replace the LED. (Nigel Batten has an glorious tutorial on BCM.)
Lowest gentle stage comparability (📷: bitluni)
This mix ends in a high-fidelity show (12 bits of coloration depth) with a body charge (98 FPS) that seems very easy to the human eye. As soon as bitluni had the LEDs working, he created the 3D-printed body that allowed them to align magnetically and the pogo pins/pads to mate.
Sadly, some points might forestall bitluni from producing the LED Matrix Magnet as a product or package. First, the pogo-pin connections generally fail to make good contact. Additionally, a design difficulty with the high-side drivers requires some dead-bug rework. However, it seems, these drivers have a less-than-ideal response charge, leading to some show quirks. So, a brand new model of the customized PCB is extra than simply fixing the pin mapping difficulty.
Take a look at the video above for a proof of the circuit and a demo. After all, being bitluni, the demo entails a Rickroll — just like when he built-in an animated GIF into an ASIC. You may obtain the CH32 code from the MagnetMatrix GitHub repository.