The ESP8266 Gets An OS, And It’s Familiar

A couple weeks back we brought you news of KernelUNO, a command line shell and very simple operating system for the Arduino Uno. It’s a neat idea, so it’s hardly surprising to see someone port it to another microcontroller and add more features.

Here’s [hery-torrado], with KernelESP for the ESP8266, which takes the original idea and adds a web console, scheduled jobs, sensor rules, scripting, NTP, and a JSON API. The networking using the ESP’s built-in WiFi takes the original and makes it significantly more useful.

It’s worth suggesting that the ability to call URLs with GET data to pass things to APIs would be useful on a networked processor too, but this is already so well featured it seems rude to ask for more. Yet again though, this project has given a new life to an old chip, and we think it has a way further to go. Perhaps a port to the ESP32 would allow it to reach its full potential, or maybe for a ridiculously cheap and powerful platform, the CH32 series of chips. We look forward to see what more will come from KernelUNO.

Our original coverage can be read here.

Rust Helps Make A $1 Handheld Console

These days, even an old Game Boy will set you back $100 or more, and a new handheld console will be many multiples of that. However, you can build a really cheap handheld gaming toy if you follow [Chris Dell’s] example.

In [Chris]’s own words, he used Rust to build a $1 handheld gaming console. How is that possible? Well, it all comes down to the CH32V003—a microcontroller cheaper than just about anything else out there. It sells for just 9 cents in bulk, and it’s no slouch either. The RISC-V device is a fully-fledged 32-bit chip running at 48 MHz, though with only 2 KB of RAM and 16 KB of flash. Still, that’s more than enough to make some little games. To this end, [Chris] paired the CH32V003 with an SSD1306 OLED display, and three tactile pushbuttons. He then whipped up some code in Rust with the aid of the ch32-hal project, implementing a neat platform game that ran at a healthy 25 fps.

The CH32V003 probably won’t be starring in a new handheld gaming revolution anytime soon. Still, it’s always interesting to see just what can be achieved with one of the cheapest microcontrollers on the market.

[Thanks to Kian Ryan for the tip!]

Wipeout Clone Runs Native On ESP32-S3

Psygnosis’s 1995 game Wipeout is remembered for two things: being one of the greatest games of all time, and taking advantage of the then-new PlayStation’s capacity for 3D graphics. The ESP32-S3 might not be your first choice to replace Sony’s iconic console, but [Michael Biggins] a.k.a. [PhonicUK] is working on doing just that, with his own clone of Wipeout on the Expressif MCU. 

It’s actually not that crazy when you think about it. The PlayStation had a 32-bit RISC processor, and the ESP32-S3 is a 32-bit RISC processor. The PlayStation’s was only good for about 30 Million Instructions Per Second (MIPS) but it had a graphics co-processor to help out with the polygons — the ESP32-S3 has two cores that can help each other, which combine to about 300 MIPS. In terms of RAM, the board in use has 8 MB of PSRAM, while the faster 512 kB on the chip is used, in effect, as video ram.

The demo is very impressive, especially considering he’s fit in three computer players. He’s also got it blasting out 60 frames per second, which is probably double what the original Wipeout ran on the PS1. Part of that is the two cores in action: he’s got them working together on the interlaced video output, one sending while the other finishes the second half of the frame. Each half of the video gets dedicated space in the internal memory. Using a 480×320 pixel display doesn’t hurt for speed, either. Sure, it’s paltry by modern standards, but the original Wipeout got by with even fewer pixels — and it didn’t run on a microcontroller. Granted it’s a beefy micro, but we really love how [Michael] is pushing its limits here.

Right now there’s just the Reddit thread and the demo video below. [Michael] is considering sharing the source code for his underlying 3D engine under an open license. We do hope he shares the code, as there are surely tricks in there some of us here could learn from. If it’s all old hat to you, perhaps you’d rather spend a weekend learning raytracing.

Continue reading Wipeout Clone Runs Native On ESP32-S3″

Compact VGA Output Board For The Pi Pico

Many microcontrollers can spit out simple analog video signals if that’s something you desire. However, it normally requires a bit of supporting hardware and, of course, the right connectors to work with your other video equipment. [Arnov Sharma] took that into account when whipping up this neat VGA board for the Raspberry Pi Pico.

VGA output in this case is achieved via judicious use of the Pi Pico’s PIO subsystem, which is perfect for clocking out the signals for red, green, and blue along with HSYNC and VSYNC as needed. The Pico slots right into [Arnov’s] custom PCB, which makes it a cinch to hook everything up. Supporting hardware is minimal, requiring just a few resistors between the Pico and the DE-15 VGA connector. There’s also a nice LM317 regulator on board to supply power to everything. [Arnov] also whipped up a modified version of the VGA library from [Pancrea85], which allows the Pico to output VGA in a way that’s more accepted by more recent TFT displays as well as older CRTs. The system is demoed with a few basic Hello, World programs, as well as a neat recreation of Conway’s Game of Life.

If you want to get a Pi Pico hooked up to a big screen quickly, whipping up a board like this is a great way to go. If you’re wanting something more advanced, though, you could always explore DVI and HDMI on the same platform. Video after the break.

Continue reading “Compact VGA Output Board For The Pi Pico”

Register Renaming

[Shreeyash] asks an interesting question: how many registers does your CPU have? The answer is probably more than you think. The reason? Modern CPUs — at least many of them — execute instructions out of sequence so they can perform multiple instructions per clock cycle. To do this, they may need to execute instructions that change registers that other instructions are still reading. In addition, you might be writing a result speculatively — a branch might make it where your result won’t wind up in the target register. The answer to both of these problems is register renaming.

The ARM CPU he looks at has many physical registers you can’t see. These get mapped to the registers you use on the fly. So when you read a register in software, you are really getting an underlying physical register. Which one? Depends on when you read it.

Continue reading “Register Renaming”

ESP32Synth : An Audio Synthesis Library For The ESP32

With MCUs becoming increasingly more powerful it was only a matter of time before they would enable some more serious audio-processing tasks. [Danilo Gabriel]’s ESP32Synth library is a good example here, which provides an ESP-IDF based 80+ voice mixing and synthesis engine. If you ever wanted to create a pretty impressive audio synthesizer, then all you really need to get started is an ESP32, ESP32-S3 or similar dual-core Espressif MCU that has the requisite processing power.

Audio output goes via I2S, requiring only a cheap I2S DAC like the UDA1334A or PCM5102 to be connected, unless you really want to use the internal DAC. With this wired up you get 80 voices by default, with up to 350 voices demonstrated before the hardware cannot keep up any more. You can stream multiple WAV files from an SD card for samples along with the typical oscillators like sinewave, triangle, sawtooth and pulse, as well as noise, wavetables and more.

In order to make this work in real-time a number of optimizations had to be performed, such as the removal of slow floating-point and division operations in the audio path. The audio rendering task is naturally pinned to a single core, leaving a single core for application code to use for remaining tasks. While the code is provided as an Arduino project, it uses ESP-IDF so it can likely be used for a regular ESP-IDF project as well without too much fuss.

ESP32 Hosts A Public Website

If you wanted to host a website, you could use any one of a number of online services, or spin up a server on a spare computer at home. If you’re a bit more daring, you could also do what [Tech1k] did, and run one on an ESP32 microcontroller.

The site in question is available (or at least, should be) at HelloESP.com. The first revision ran entirely on an ESP32, serving pages from a SPIFFS filesystem. The device was also fitted with a BME280 environment sensor and an OLED screen. It had an uptime of 500 days before the board failed.

The site has since been relaunched, running on a board that is framed on [Tech1k]’s wall. It runs on an ESP32-WROOM-32D, paired with a BME280 again, along with a CCS811 CO2 and air quality sensor and a DS3231 RTC for accurate timekeeping. The ESP32 is setup to hold an outbound WebSocket to a Cloudflare worker, with the Worker routing HTTP requests to the site via that route. This avoids the need for port forwarding for the ESP32 to be visible to the outside world, and the Cloudflare Worker will also serve a static version of the page in the case of WiFi dropouts or other temporary failures.

It’s true that this isn’t a completely unheard of project—microcontrollers have been working as simple web servers for a long time now. Still, [Tech1k] did a great job of making this as robust as possible and more like a real functional webserver rather than just something that runs on a local network to serve up a config page. That’s worthy of note.

You can run webservers on all kinds of chips these days, even the Raspberry Pi Pico. If you’re doing web stuff on something weird, you know we always wanna hear about it on the tipsline!