RP2040 Assembly Language Mix And Match

[David] is building a project with an OLED, a keyboard, and an RP2040. He’s perfected a scanning routine in C to work with the keyboard, but he still had some places he wanted to use even lower-level instructions. That was as good an excuse as any to experiment with inline assembly language inside the C program.

The goal was to grab the keyboard’s input and stick it into a memory address register so the data at that address could be shown on the display. However, there was a complication because memory access of this type has to be word-aligned.

Sure, you could mask the low bits of the address, do the read, and then set an index to pick the specific byte, but assembly is easy, and it is good to know how to put it in your code, anyway.

Continue reading “RP2040 Assembly Language Mix And Match”

ESP32 bus pirate

ESP32 Sets Sail As A Modern Bus Pirate Powerhouse

Bus Pirate is nearly a household name in the hardware hacking world. The first version came out way back in 2008, and there have been several revisions since then. You can buy pre-built Bus Pirate devices, but there’s also the option now to build our own. The ESP32 Bus Pirate project has everything you need to turn an ESP32 device into a protocol sniffing/decoding powerhouse—all on a board you may have sitting around from another project.

There are a ton of solutions when it comes to talking to different buses —I2C, UART, JTAG, you name it, there’s a purpose-built device for it. Over a decade ago, Dangerous Prototypes released the Bus Pirate, offering a Swiss Army knife of a tool to interface with this ever-expanding list of communications standards. The ESP32 Bus Pirate project is open-source firmware for ESP32s that gives them the ability to be the multi-tool that lets us communicate with a long list of protocols.

It supports a wide variety of devices, from the straightforward ESP32 S3 Dev Kit available from a long list of suppliers to the more specialized M5 Cardputer equipped with its own keyboard. The original Bus Pirate required plugging the board into a PC to use it; with this being ESP32-based, that’s no longer a limitation. So long as you can supply power to the ESP32, you can connect and control it via WiFi and a web browser. In addition to the Bus Pirate protocols, the project allows us to directly control the pins on the ESP32 board, should you want to do more with it besides interfacing with one of the supported protocols. Be sure to check out some of our other articles about Bus Pirate, as it’s been a fantastic tool for the hacker community over the years.

A hand holds a charcoal-colored rectangle with a black and white screen in taking up most of its face. A bulleted list of items are displayed: "Start work on new blog, Update eSticky FW, Start working on eSticky PCB, New enclosure for eSticky, Buy 18650 battery, Buy 3DP extruder anycubic, FW Update Sigma 18-35."

ESticky Is A Paperless Post-It

E-paper screens have opened up a wide variety of novel use cases that just wouldn’t work with the higher power draw of an LCD. [gokux] thought it would be perfect for a digital sticky note.

Using a Waveshare 2.9″ e-paper display hooked up to a Seeed Studio XIAO ESP32C3, a battery, and a switch all inside the 3D printed enclosure, the part count on this is about as simple as it gets. Once everything is soldered together and programmed, you get a nifty little display that can hold some of your thoughts without having to reopen an app to get to them.

Access is currently provided via a web page, and there are a few minor hiccups like text alignment and image upload support. This project is open source, so [gokux] has expressed interest in anyone wanting to help refine the concept. We think it might be nice to add a magnet on the back for an easier way to actually stick to things.

If you prefer a different way to use electricity for a sticky note, why not do it at 2,000 V? If that’s not your jam, how about a plotter that writes your label or message on masking tape?

Continue reading “ESticky Is A Paperless Post-It”

Web Dashboard For Zephyr

Over time, web browsers have accumulated a ton of features beyond what anyone from the 90s might have imagined, from an application platform to file management and even to hardware access. While this could be concerning from a certain point of view, it makes it much easier to develop a wide range of tools. All a device really needs to use a browser as a platform is an IP address, and this project brings a web UI dashboard to Zephyr to simplify application development.

Zephyr is a real-time operating system (RTOS) meant for embedded microcontrollers, so having an easy way to access these systems through a web browser can be extremely useful. At its core, this project provides a web server that can run on this operating system as well as a REST API that can be used by clients to communicate with it. For things like blinking lights this is sufficient, but for other things like sensors that update continuously the dashboard can also use WebSocket to update the web page in real time.

The web dashboards that can be built with this tool greatly reduce the effort and complexity needed to interact with Zephyr and the microcontrollers it typically runs on, especially when compared to a serial console or a custom application that might otherwise be built for these systems. If this is your first time hearing about this RTOS we recently featured a microcontroller-based e-reader which uses this OS as a platform.

Continue reading “Web Dashboard For Zephyr”

Pinout of 74HC595

Using The 74HC595 Shift Register To Drive 7-Segment Displays

In a recent video our hacker [Electronic Wizard] introduces the 74HC595 shift register and explains how to use it to drive 7-segment displays.

[Electronic Wizard] explains that understanding how to apply the 74HC595 can increase the quality of your projects and also help keep the demands on the number of pins from your microcontroller to manageable levels. If you’re interested in the gory details you can find a PDF datasheet for the 74HC595 such as this one from Texas Instruments.

[Electronic Wizard] explains further that a shift register is like a small one byte memory where its data is directly available on its eight output pins, no input address required. When you pulse the clock pin (CLK) each bit in the eight bit memory shifts right one bit, making room for a new bit on the left. The bits that fall off the right hand side can daisy chain into another 74HC595 going out on pin 9 and coming in on pin 14.

Continue reading “Using The 74HC595 Shift Register To Drive 7-Segment Displays”

A diagram with one Tag and two Base Stations.

Using Ultra-Wideband For 3D Location And Tracking

Interested in playing with ultra-wideband (UWB)? [Jaryd] recently put together a fairly comprehensive getting started guide featuring the AI Thinker BU03 that looks like a great place to start. These modules can be used to determine distance between two of them to an accuracy in the order of 10 centimeters, and they can do so in any orientation and with obstacles in the line of sight. It is possible to create a network of these UWB modules to get multiple distance measurements at once and enable real-time 3D tracking for your project.

[Jaryd] gathers up nine UWB modules and uses a Raspberry Pi Pico for command and control purposes. He explains how to nominate the “tag” (the device being tracked) and the “base stations” (which help in locating the tag). He reports having success at distances of up to about 10 meters and in favorable circumstances all the way up to as much as 30 meters.

If you don’t know anything about UWB and would like a primer on the technology be sure to check out What Is Ultra Wideband?

2025 One Hertz Challenge: STM32 Blinks In Under 50 Bytes

Many of us have run a Blink program on a microcontroller before. It’s effectively the “Hello, World!” of the embedded space. However, few of us have ever thought about optimizing our Blink code to be as miniscule as possible. But that’s precisely what [Rudra Lad] did for this entry into the 2025 One Hertz Challenge!

This example of Blink, delay_blinky_13, is built specifically for the STM32F4 Discovery microcontroller development board. [Rudra] notes the code is “highly optimized” and compiles down to a binary size of under 50 bytes. The code doesn’t even use RAM, and it aims to get the blink as close to 1 Hz as possible. Many optimizations were used to crunch it down as small as possible. For example, the standard startup code isn’t used, with the entire program instead written in the Reset_Handler to save space. Bit-band is also used to write to peripheral registers to blink the LED, since this uses less instructions than the typical methods. Meanwhile, with many tweaks to the delay counting routine, [Rudra] was eventually able to get the blink frequency to 1.00019 Hz, as measured on a logic analyzer. That’s pretty darn close!

While it’s rare that you have only 50 bytes of binary space to blink an LED, work like this is a great way to flex your coding muscles. Code is on Github for the curious, and if you’ve worked up your own impressive tiny binaries, don’t hesitate to let us know!