Test Your ‘Blue Pill’ Board For A Genuine STM32F103C8 MCU

With the market for STM32F103C8-based ‘Blue Pill’ boards slowly being overrun with boards that contain either a cloned, fake or outright broken chip, [Terry Porter] really wanted to have an easy, automated way to quickly detect whether a new board contains genuine STM32 silicon, or some fake that tries to look the part. After more than a year of work, the Blue Pill Diagnostics project is now ready for prime time.

We have covered those clone MCUs previously. It’s clear that some of those ‘Blue Pill’ boards obviously do not have a genuine STM32 MCU on them, as they do not have the STM32 markings on them, while others fake those markings on the package and identifying can be hard to impossible. Often only testing the MCU’s actual functionality can give clarity on whether it’s a real STM32 MCU.

These diagnostics allow one to test not only the 64 kB of Flash, but also the 64 kB of ‘hidden’ Flash that’s often found on these MCUs (rebadged 128 kB STM32F103 cores). It further checks the manufacturer JDEC code and uses a silicon bug in genuine STM32F1xx MCUs where the BGMCU_IDCODE cannot be read without either SWD or JTAG connected.

Another interesting feature of Blue Pill Diagnostics is using Mecrisp-Stellaris Forth as its foundation, which allows for easy access to a Forth shell via this firmware as well, not unlike MicroPython and Lua, only in a fraction of the Flash required by those. We have previously written about using Mecrisp-Stellaris in your projects.

Blue Pill Vs Black Pill: Transitioning From STM32F103 To STM32F411

For many years now, the so-called ‘Blue Pill’ STM32 MCU development board has been a staple in the hobbyist community. Finding its origins as an apparent Maple Mini clone, the diminutive board is easily to use in breadboard projects thanks to its dual rows of 0.1″ pin sockets. Best of all, it only costs a few bucks, even if you can only really buy it via sellers on AliExpress and EBay.

Starting last year, boards with a black soldermask and an STM32F4 Access (entry-level) series MCUs including the F401 and F411 began to appear. These boards with the nickname ‘Black Pill’ or ‘Black Pill 2’. F103 boards also existed with black soldermask for a while, so it’s confusing. The F4xx Black Pills are available via the same sources as the F103-based Blue Pill ones, for a similar price, but feature an MCU that’s considerably newer and more powerful. This raises the question of whether it makes sense at this point to switch to these new boards.

Our answer is yes, but it’s not entirely clearcut. The newer hardware is better for most purposes, really lacking only the F103’s dual ADCs. But hardware isn’t the only consideration; depending on one’s preferred framework, support may be lacking or incomplete. So let’s take a look at what it takes to switch. Continue reading “Blue Pill Vs Black Pill: Transitioning From STM32F103 To STM32F411”

STM32 Offers Performance Gains For DIY Oscilloscope

There’s no shortage of cheap digital oscilloscopes available today from the usual online retailers, but that doesn’t mean the appeal of building your own has gone away — especially when we have access to powerful microcontrollers that make it easier than ever to spin up custom gear. [mircemk] is using one of those microcontrollers to build an improved, pocket-sized oscilloscope.

The microcontroller he’s chosen is the STM32F103C8T6, part of the 32-bit STM family which has tremendous performance compared to common 8-bit microcontrollers for only a marginally increased cost. Paired with a small 3-inch TFT color display, it has enough functions to cover plenty of use cases, capable of measuring both AC and DC signals, freezing a signal for analysis, and operating at an impressive 500 kHz at a cost of only around $15. The display also outputs a fairly comprehensive analysis of the incoming signal as well, with the small scope capable of measuring up to 6.6 V on its input.

This isn’t [mircemk]’s first oscilloscope, either. His previous versions have used Arduinos, generally only running around 50 kHz. With the STM32 microcontroller the sampling frequency is an order of magnitude higher at 500 kHz. While that’s not going to beat the latest four-channel scope from Tektronix or Rigol, it’s not bad for the form factor and cost and would be an effective scope in plenty of applications. If all you have on hand is an 8-bit microcontroller, though, we have seen some interesting scopes built with them in the past.

Simple STM32 Frequency Meter Handles Up To 30MHz With Ease

[mircemk] had previously built a frequency counter using an Arduino, with a useful range up to 6 MHz. Now, they’ve implemented a new design on a far more powerful STM32 chip that boosts the measurement range up to a full 30 MHz. That makes it a perfect tool for working with radios in the HF range.

The project is relatively simple to construct, with an STM32F103C6 or C8 development board used as the brains of the operation. It’s paired with old-school LED 7-segment displays for showing the measured frequency. Just one capacitor is used as input circuitry for the microcontroller, which can accept signals from 0.5 to 3V in amplitude. [mircemk] notes that the circuit would be more versatile with a more advanced input circuit to allow it to work with a wider range of signals.

It’s probably not the most accurate frequency counter out there, and you’d probably want to calibrate it using a known-good frequency source once you’ve built it. Regardless, it’s a cheap way to get one on your desk, and a great way to learn about measuring and working with time-varying signals. You might like to take a look at the earlier build from [mircemk] for further inspiration. Video after the break.

Continue reading “Simple STM32 Frequency Meter Handles Up To 30MHz With Ease”

Bench Power Supply Turned Realistic Flight Sim Panel

Flight simulator software has been available for about as long as desktop PCs have been a thing, but modern incarnations such as 2020’s Microsoft Flight Simulator have really raised the bar — not only graphically, but in terms of interactivity. There’s a dizzying array of switches and buttons that you can fiddle with in your aircraft’s virtual cockpit, but doing it with the same keyboard that you use to hammer out code or write Hackaday articles doesn’t do much for immersion.

Looking to improve on the situation without having to shell out for an expensive sim panel, [Michael Fitzmayer] decided to convert a broken Manson SSP-8160 lab power supply into a fairly good approximation of the KAP 140 autopilot system which is used in one of his favorite aircraft, the Pilatus PC-6 Turbo-Porter.

[Michael] gutted the piece of equipment pretty thoroughly, only leaving behind the case itself and the illuminated button panel on the front. The original displays were replaced with TM1637 seven-segment LEDs, and a pair of new rotary encoders are mounted where the stock knobs were. The whole show is run by a STM32F103 Blue Pill, which conveys the button pressing and knob spinning to the game by mimicking a USB Human Interface Device.

A fascia applied to the front of the power supply blocks the original text and labels, and really makes the finished unit look the part. [Michael] admits it’s not 100% accurate to the layout of the real hardware, but it’s certainly better than trying to enter heading and altitude information with the controller.

Oh that’s right, did we mention he’s actually using this on the Xbox Series S? While we generally see this sort of sim hardware hooked up to a tricked out gaming computer, we appreciate that he’s trying to bring some of that same experience to the console world. While the one-way communication of USB HID does bring with it some limitations — for example the hardware needs to be manually reset at the beginning of each flight to make sure the physical displays match what’s shown in the virtual cockpit– there’s still a lot of potential here.

For example, you could design and build your own flight yoke, pedals, and throttles rather than spending hundreds on a commercial version. It sounds like [Michael] is just getting started in the world of affordable console-based flight simulation, and we’re very eager to see where he goes from here.

The New Hotness

If there’s one good thing to be said about the chip shortage of 2020-2023 (and counting!) it’s that a number of us were forced out of our ruts, and pushed to explore parts that we never would have otherwise. Or maybe it’s just me.

Back in the old times, I used to be a die-hard Atmel AVR fan for small projects, and an STM32 fan for anything larger. And I’ll freely admit, I got stuck in my ways. The incredible abundance of dev boards in the $2 range also helped keep me lazy. I had my thing, and I was fine sticking with it, admittedly due to the low price of those little blue pills.

An IN-12B Nixie tube on a compact driver PCBAnd then came the drought, and like everyone else, my stockpile of microcontrollers started to dwindle. Replacements at $9 just weren’t an option, so I started looking around. And it’s with no small bit of shame that I’ll admit that I hadn’t been keeping up with the changes as much as I should have. Nowadays, it’s all ESP32s and RP2040s over here, and granted there’s a bit of a price bump, but the performance is there in abundance. But I can’t help feeling like I’m a few years back of the cutting edge.

So when I see work like what [CNLohr] and [Bitluni] are doing with the ultra-cheap CH32V003 microcontrollers, it makes me think that I need to start filling in gaps in my comfortable working-set of chips again. But how the heck am I supposed to keep up? And how do you? It took a global pandemic and silicon drought to force me out of my comfort zone last time. Can the simple allure of dirt-cheap chips get me out? We’ll see!

An Affordable And Programmable PLC

We’re all used to general purpose microcontroller boards such as the Arduino or its many imitators, but perhaps we don’t see as much of their industrial cousins. A programmable logic controller (PLC) is a computer designed to automate industrial machinery, and comes with protected interfaces and usually a specific PLC programming environment. Thus [Galopago]’s work with an inexpensive Chinese PLC clone is especially interesting, providing a route forward to using it within the Arduino IDE ecosystem.

Opening it up, the processor is identified as an STM32F103, and the connection needed to place it in bootloader mode is identified. Then it can be programmed from the Arduino IDE, even though its bootloader can’t be changed. Then to complete the process it’s necessary to identify the various different inputs and outputs by old-fashioned hardware reverse engineering.

This PLC may not be quite as robust as some products costing much more money, but it still represents a cost-effective way to access a microcontroller board with much of the interface circuitry already installed that would normally be required for controlling machinery. We expect that we’ll be seeing it appear on these pages over the coming months, and perhaps there might even be another comparison in the air.