In case your workshop already has piles of {hardware} in all places you look, then you definately most likely need to skip out on shopping for new devices that you just really need sometimes. However if in case you have even one USB port open in your laptop, you have received all of the area you want for a brand new improvement board referred to as Comu. Measuring simply 13 × 9.4 mm, the complete machine suits inside a USB-A connector, but it comes outfitted with a 32-bit RISC-V microcontroller, 4 capacitive contact buttons, two LEDs, and sufficient uncovered GPIO pins to make it helpful for lots greater than blinking a lightweight.
Comu is constructed across the WCH CH32V203, a RISC-V microcontroller operating at as much as 144 MHz. It has 224 KB of general-purpose flash, 24 KB of boot flash, and 20 KB of SRAM, together with {hardware} peripherals together with DMA, a 12-bit ADC, and full-speed USB. Six GPIO pins are additionally uncovered by way of check pads, so the tiny board may be built-in into bigger {hardware} initiatives.
It could actually’t get a lot smaller (📷: Cyao)
Its most blatant purposes, nevertheless, benefit from the truth that Comu plugs instantly into a pc. It could actually function as a USB HID machine, making it doable to construct tiny programmable controllers for repetitive duties. The 4 capacitive contact buttons may turn into media controls, a quantity slider, a sleep button, screenshot controls, or shortcuts for continuously used purposes.
These contact controls are constructed instantly into the perimeters of the PCB utilizing double-sided plated contacts. The CH32V203 additionally features a devoted TouchKey peripheral, which handles a lot of the work usually required to implement capacitive contact sensing.
The board’s sources are fairly restricted, so Comu is primarily supposed for light-weight bare-metal improvement utilizing ch32fun. With out a lot overhead, some pretty advanced applications can match throughout the microcontroller’s constraints. In keeping with the undertaking’s developer, a fundamental blinking LED program takes simply 40 bytes, in contrast with 12 KB utilizing the Raspberry Pi Pico SDK and 324 KB utilizing the Arduino IDE with the Pico.
The board format (📷: Cyao)
To help the tiny type issue of the board, a customized, open supply bootloader was developed for Comu. As a result of there is not room for a BOOT0 button, the customized bootloader provides customers a five-second window after plugging Comu in to add new firmware. It occupies simply 2 KB, leaving a lot of the CH32V203’s devoted boot flash accessible for different functions.
Naked-metal C and C++ programming is the best choice, however not the one possibility. The CH32V203 can be programmed utilizing Rust with ch32-hal, Arduino by way of arduino_core_ch32, or WCH’s HAL with MounRiver Studio II.
Libraries similar to TinyUSB can deal with USB communications if instantly manipulating packets is not your cup of tea. Then again, direct entry to the USB peripheral is a part of Comu’s attraction. Builders can manipulate uncooked USB packets and pair the board with instruments like usbmon and Wireshark, turning this computer-in-a-USB-plug right into a tiny platform for studying how USB really works.
Comu has a tiny price ticket to go along with its pint-sized footprint — you possibly can choose one up for $5.99 on Tindie.