ESP32 Hosts A USB Keyboard In This Typewriter

Did you know the ESP32 can be a USB host? Well it can, and [Volos] uses host mode to build this fun little word processor.

The venerable ESP32 has a well-known USB device mode. Anyone who has programmed one has used it. A bit less known is the microcontroller’s ability to host USB devices. These days, operating as a USB device is relatively simple. But acting as a host is a much more complex task. The ESP32 has a software host that works — but only for Human Interface Devices (HID).  Human interface devices generally are keyboards, mice, trackballs, and similar devices that handle data relatively slowly, forming the interface with us simple humans.

[Volos] uses the EspUsbHost Arduino library for this project. The library makes USB host mode simple to use. Another piece of the puzzle is the LCD board [Volos] picked. It has a dual-role USB Type-C port, meaning the hardware to switch roles is baked in. Other boards may require some modifications or special cables to make things work.

The software is the best part of this build. [Volos] implemented a simple word processor. It can save and load files from a microSD card and, of course, edit text — all controlled by a USB keyboard. He had to use a 4-bit palette to save memory. This gives the device a retro charm that reminds us of Don Lancaster’s TV Typewriter. The source for this and all of [Volos] projects can be found on GitHub. Now, all we need is a spell check that can fit in the memory constraints of the ESP32! We have to admit the chip has a lot of potential USB tricks.

Continue reading “ESP32 Hosts A USB Keyboard In This Typewriter”

[rasteri] holding his HIDMan USB dongle

HIDman Brings Modern Input To Vintage PCs

Retro computing enthusiasts, rejoice! HIDman, [rasteri]’s latest open source creation, bridges the gap between modern USB input devices and vintage PCs, from the IBM 5150 to machines with PS/2 ports. Frustrated by the struggle to find functioning retro peripherals, [rasteri] developed HIDman as an affordable, compact, and plug-and-play solution that even non-techies can appreciate.

The heart of HIDman is the CH559 microcontroller, chosen for its dual USB host ports and an ideal balance of power and cost-efficiency. This chip enables HIDman’s versatility, supporting serial mice and various keyboard protocols. Building a custom parser for the tricky USB HID protocol posed challenges, but [rasteri]’s perseverance paid off, ensuring smooth communication between modern devices and older systems.

Design-wise, the project includes a thoughtful circuit board layout that fits snugly in its case, marrying functionality with aesthetics. Retro computing fans can jump in by building HIDman themselves using the files in the GitHub repository, or by opting for the ready-made unit.

Continue reading “HIDman Brings Modern Input To Vintage PCs”

PicoROM, A DIP-32 8-Bit ROM Emulator

As we all know, when developing software for any platform or simply hacking a bit of code to probe how something works, the ability to deploy code rapidly is a huge help. [Martin Donlon], aka [wickerwaka], is well known in retro gaming and arcade hardware reverse engineering circles and had the usual issues figuring out how an arcade CPU board worked while developing a MiSTer core. Some interesting ASICs needed quite a bit of poking, and changing the contents of socketed ERPOMs is a labour-intensive process. The solution was PicoROM, a nicely designed ROM emulator in a handy DIP-32 form factor.

As the title suggests, PicoROM is based on the Raspberry Pi RP2040. It emulates an 8-bit ROM up to 2MBits in size with speeds up to 100ns. Since it uses the RP2040, USB connectivity is simple, enabling rapid uploading of new images to one (or more) PicoROMs in mere seconds. A vertically orientated USB-C connector allows multiple PicoROMs to be cabled to the host without interfering with neighbouring hardware. The firmware running on core 1 passes data from the internal 264K SRAM, using the PIO block as a bus interface to the target. A neat firmware feature is the addition of a mechanism to use a ROM region as a bidirectional control channel, which the software running on the target can use to communicate back to the host computer. This allows remote triggering of actions and the reporting of responses. Responses which may not be physically observable externally. [Martin] is using this feature extensively to help probe the functionality of some special function chips on the target boards, which is still a slow process but helped massively by reducing that critical software iteration time. The PCB was designed with KiCAD. The project files for which can be found here.

This isn’t the first time we’ve seen the RP2040 used for ROM emulation; here’s a pile of wires that does the same job. It just isn’t as pretty. Of course, if you really must use EPROMs, then you could give this sweet programmer a look over.

Continue reading “PicoROM, A DIP-32 8-Bit ROM Emulator”

Ubiquitous Successful Bus: Hacking USB 2 Hubs

We’ve been recently looking into USB 2.0 – the ubiquitous point-to-point communications standard. USB 2 is completely different from USB 3, the blue-connector next-generation USB standard. For instance, USB 2 is a full-duplex pseudo-differential bus, and it’s not AC-coupled. This makes USB2 notoriously difficult to galvanically isolate, as opposed to USB 3.  On the other hand, USB 2 is a lot easier to incorporate into your projects. And perhaps the best way to do so is to implement a USB hub.

USB 2 hubs are, by now, omnipresent. it doesn’t cost much to add to your board, and you truly have tons of options. The standard option is 4-port hubs – one uplink port to your host, four downlink ports to your devices. If you only have two or three devices, you might be tempted to look for a hub IC with a lower amount of ports, but it’s not worth bothering – just use a 4-port chip, and stock up on them.

What about 7-port chips? You will see those every now and then – but take a close look at the datasheet. Some of them will be two 4-port chips inside a single package, with four of the ports bottlenecked compared to the three other ports – watch out! Desktop 7-port hubs are basically guaranteed to use two 4-port ICs, too, so, again, watch out for bottlenecks. lsusb -t will help you determine the hub’s structure in case you don’t want to crack its case open, thankfully.

Recommendations? I use SL2.1 chips – they’re available in an SO16 package, very unproblematic, to-the-point pinout and easily hand-solderable. CH334 is a close contender, but watch out because there are different variants of this chip that differ by both package and pinout, so if you’re buying a chip with a certain letter, you will want to stick to it. Not just that, be careful – different variants run out at different rates, so if you lock yourself into a CH334 variant, consider stocking up on it. Continue reading “Ubiquitous Successful Bus: Hacking USB 2 Hubs”

Custom Fan Controller For Otherwise Fanless PCs

Most of us using desktop computers, and plenty of us on laptops, have some sort of fan or pump installed in our computer to remove heat and keep our machines running at the most optimum temperature. That’s generally a good thing for performance, but comes with a noise pollution cost. It’s possible to build fanless computers, though, which are passively cooled by using larger heat sinks with greater thermal mass, or by building more efficient computers, or both. But sometimes even fanless designs can benefit from some forced air, so [Sasa] built this system for cooling fanless systems with fans.

The main advantage of a system like this is that the fans on an otherwise fanless system remain off when not absolutely necessary, keeping ambient noise levels to a minimum. [Sasa] does have a few computers with fans, and this system helps there as well. Each fan module is WiFi-enabled, allowing for control of each fan on the system to be set up and controlled from a web page. It also can control 5V and 12V fans automatically with no user input, and can run from any USB power source, so it’s not necessary to find a USB-PD-compatible source just to run a small fan.

Like his previous project, this version is built to easily integrate with scripting and other third-party software, making it fairly straightforward to configure in a home automation setup or with any other system that is monitoring a temperature. It doesn’t have to be limited to a computer, either; [Sasa] runs one inside a server cabinet that monitors the ambient temperature in the cabinet, but it could be put to use anywhere else a fan is needed. Perhaps even a hydroponic setup.

Continue reading “Custom Fan Controller For Otherwise Fanless PCs”

Ubiquitous Successful Bus: Version 2

I’ve talked a fair bit about USB-C before, explaining how it all works, from many different angles. That said, USB-C is just the physical connector standard, plus the PD part that takes care of voltages and altmodes – things like data transfer are still delegated to the two interfaces you invariably end up using on USB-C ports, USB 2, and USB 3.

You might think USB 2 and USB 3 are tightly related, but in many crucial ways, they couldn’t be more different. I have experience working with both, and, as you might guess, I want to share it all with you. You might be surprised to hear there’s plenty to learn about USB 2 in particular – after all, we’ve had it hang around for 30 years now. Well, let’s make sure you’re fully caught up!

The Ingredients

USB 2 is a point-to-point link – one side is “host” and another is “device”, with the host typically being a PC chipset or a single-board computer. USB 2 relies on a single pseudodifferential pair. It’s “pseudodifferential” because the wires don’t just do differential signaling – they also use digital logic levels and pullup/pulldown resistors to signal device presence, especially in the beginning when the USB link is still getting established. Indeed, you can imitate a USB device’s presence with just a resistor.
Continue reading “Ubiquitous Successful Bus: Version 2”

A black OLED screen with a happy face displayed upon it is situated at the top of a squarish calculator with a 5x6 grid of white calculator keys. It floats above a graphing calculator, Nintendo Switch, aigo numpad, and an Arduino Mega on a white table. A handful of differently-colored kalih choc switches are in various places around the table.

Mechanical Switch Sci-Calc Is Also A Macropad

Smartphones have replaced a desktop calculator for most folks these days, but sometimes that tactility is just what you need to get the mathematical juices flowing. Why not spruce up the scientific calculator of yore with the wonders of modern microcontrollers?

While you won’t be able to use Sci-Calc on a standardized test, this classy calculator will let you do some pretty cool things while clacking on its mechanical choc switches. Is it a calculator? Obviously. Is it an Arduboy-compatible device that can play simple games like your TI-84? Yes. Is it also a macropad and ESP32 dev board? Why not? If that isn’t enough, it’s also takes both standard and RPN inputs.

[Shao Duan] has really made this device clean and the menu system that rewrites main.bin based on the program selection is very clever. Escape writes main.bin back into the ROM from the SD card so you can select another application. A few classic games have already been ported, and the process looks fairly straightforward for any of your own favorites.

If you’re hankering for more mathy inputs, checkout the Mathboard or the MCM/70 from 1974.

Continue reading “Mechanical Switch Sci-Calc Is Also A Macropad”