Hello again, world
After nearly a year of silence, I’ve started writing articles again. Much has happened, but I’m still delighted by the sight of a tiny blinking LED and the smell of a good solder joint. New look, same...
View ArticleHardware CRC calculation
Most (all?) STM32 microcontrollers have a built-in hardware checksum calculation unit. From Wikipedia: A cyclic redundancy check (CRC) is an error-detecting code commonly used in digital networks and...
View ArticleRandom numbers in hardware
Random numbers are useful for simulations, to create a sense of arbitrariness in games that might make them more “interesting”, i.e. generally speaking: to introduce a level of unpredicatability in the...
View ArticleToggling I/O pins on STM32
All microcontrollers have I/O pins to connect to the outside world. These can be used as inputs or outputs, and tend to have various interesting capabilities. Here, I’ll treat these “General Purpose...
View ArticleGetting started with the Blue Pill
The “Blue Pill” is a small development board with an STM32F103 32-bit ARM µC on it, plus essential supporting logic. It’s widely available and very low-cost. See this wiki page on the STM32duino...
View ArticleTurning a Blue Pill into a Z80
The Z80 micrcomputer was a revolutionary chip in the 1970’s - a more capable alternative to the Intel 8080. The commercially smart move was that it implemented (almost exactly) the same instruction set...
View ArticleSTM32F103 low-power mode
I’ve always kept an interest in low-power explorations, most of which I did many years ago. First there was the ATmega328, then the LPC824, and finally on the STM32L052. One reason, is that I find it...
View ArticleCurrent measurements
An F103 with a current consumption of 45 µA is nothing to be ashamed of. This translates to about 6 months of runtime on a CR2032 coin cell (although not doing anything useful). That is two orders of...
View ArticleZ80 and CP/M in a red box
Some people like computers from the previous century, the ones which are long obsolete, unusable, or have been mostly forgotten. Perhaps because they owned one in the past, or because they never could...
View ArticleThe CAN bus
The CAN bus is a very interesting medium-speed “interconnect”, for various reasons: it’s based on just 2 signal wires and the bus is completely passive it’s made for noisy environments, e.g. cars,...
View ArticleThe CAN bus, part 2
If you place a dozen people in a room – let’s say a bunch of CAN bus geeks – then more likely than not, a discussion will start to emerge. Interestingly, it’ll not be chaos: people will listen when...
View ArticleThe CAN bus, part 3 - STM32
With the basics out of the way, it’s time to look at the actual hardware peripheral, as used in STM32 microcontrollers. It turns out the CAN hardware is almost identical across all STM32 families....
View ArticleThe CAN bus, part 4 - JeeH API
Enough already of all this theory … it’s time to put the CAN bus into practice. Since my goal is not just to get CAN working, but also to fully explain how it can be implemented on an STM32 µC, I will...
View ArticleThe CAN bus, part 5 - Demo
Demo time! As test setup, I’m going to use an F4-based STM32 µC, since it has two CAN bus controllers. It’s easier to write a quick test for a single system. And since I have these boards lying around,...
View ArticleThe CAN bus, part 6 - Single-wire
There is a second way to use the CAN bus: in “single wire” mode (SW-CAN). But before I go into that, let me set up a dual-node bus, using standard MCP2551 transceivers for a “normal” CAN bus with...
View ArticleRetrocomputing on STM32F407
The Blue Pill is a wonderful little board, and my first choice for many projects requiring a small and very low-cost µC board. Especially with PlatformIO’s excellent support for it. Even for...
View ArticleGetting started with the F407
The first thing to try out on every new board is to blink an LED: the embedded equivalent of writing a “Hello World” program. I’m going to do this for both the “DIYmore” and the “Black407” boards, as...
View ArticleTurning a Black F407 into a Z80
This is an amalgamation of two recent articles: Turning a Blue Pill into a Z80 and Getting started with the F407. I want to use this as starting point for further retro Z80 explorations. The first goal...
View ArticleCP/M on F407, part 1 - Intro
CP/M from the 1970’s was an operating system for 8080 and Z80 8-bit micrcomputers. It was very popular among hobbyists, because it came at the right time and offered a way to manage data file storage...
View ArticleCP/M on F407, part 2 - Storage
CP/M is a disk operating system. It relies on one or more “disks” for permanent storage, which persists while the computer is off. At the time, 8” floppy drives had just started to become available, at...
View ArticleCP/M on F407, part 3 - The BIOS
As mentioned in the intro of this little CP/M series, the CP/M hardware abstraction layer is provided in a “BIOS”. This is a system-specific section of code which interfaces the main part of CP/M with...
View ArticleCP/M on F407, part 4 - Booting
The last piece of the puzzle is to make all the parts line up and work together. This turns out to be quite involved. A large part is due to the “virtualness” of this whole CP/M setup: we need a way to...
View ArticleCP/M on F407, part 5 - Power up
It’s time to stop talkin’ and start walkin’ … Disk initialisation As mentioned in the previous article, the last step is about getting the virtual disk in flash formatted and set up correctly. But...
View ArticleCP/M on F407, part 6 - Finish
So now we have a running CP/M system, great. Except that it has no content, and no means to get any new content onto the virtual disk. That makes it pretty much useless. Intel HEX We need one more step...
View ArticleLow-power L031 ... maybe
The exploration into low-power sleep modes continues. An STM32F103 draws just 3 µA in standby mode, but that’s not the end of the story. The STM32L0xx µCs are more modern and even lower-power. So I...
View ArticleThe ADC and its watchdog
The STM32 L0-series and newer µCs have an interesting feature: the ADC “watchdog”. Some variants have more than one, in fact. This mechanism can keep track of analog voltages in the digital world,...
View ArticleThe DAC and its DMA buddy
After yesterday’s article about ADC, it seems fitting to describe the other side of the coin: the digital-to-analog converter (DAC) and how to generate an analog waveform with it. DAC is easy This is...
View ArticleThe Mac is going downhill
Many years ago, I had an 11” MacBook Air. The tapered one. Bought it literally on a whim, accepting whatever model the store had available right then and there (4 GB RAM and 128 GB SSD), and took it...
View ArticleThe PlatformIO command line
Software development for embedded microcontrollers requires – as a minimum – 1) a text editor to enter and tweak source code, 2) a “toolchain” to compile and link the code into a firware image suitable...
View ArticleMeasuring current with Disco-L053
It turns out that there’s a nice way to measure current consumption with a commercial board by ST Microelectronics. It’s called the 32L0538-DISCOVERY, but for brevity and consistency I’m going to call...
View ArticleMeasuring with Disco-L053, part 2
The previous article mentioned that the “Disco-L053” board includes a complete current measuring circuit, which can handle a range of nearly six decades. So here is a brief description of how to...
View ArticleLooking for something?
function search(elt) { elt.q.value=elt.q.value+” site:jeelabs.org” } This is a list of “stuff” I’ve worked on over the years, in reverse chronological order: This site has changed shape a few times,...
View Article