M0AGX / LB9MG

Amateur radio and embedded systems

  • Water leak app notification in Home Assistant

    Home Assistant is an extremely flexible home automation solution that does not come in a magic locked-down box. The flexibility comes with difficulty figuring out how to actually do things because of so many options and different approaches (just like with Linux overall).

    I installed some Zigbee water leak sensors …

    Read more...

  • Migrating to Pelican

    Returning readers: please update your feed reader with the new RSS or Atom URL.

    Last updated 06 Aug 2023.

    I decided to migrate my blog from Wordpress to a static site generator. My main motivation, apart from just trying something new for the sake of it, was the endless stream …

    Read more...

  • Oscilloscope bandwidth benchmark

    What is the impact of oscilloscope bandwidth on the observed signals? Does a bandwidth of 25 MHz mean that a scope will display a 30 MHz signal only with a lower amplitude? Can oscilloscopes work around Nyquist with equivalent sampling? Is a scope four times the bandwidth worth four times …

    Read more...

  • STM32 stop mode & EXTI wakeup without HAL

    Low-power modes come in handy (apart from obvious power saving) when the electromagnetic emissions of an MCU have to be reduced. For example when an MCU is placed close to antenna switching relays - you definitely do not want to receive the noise from the MCU in your HF transceiver (even …

    Read more...

  • Matching STM32 hardware CRC with standard CRC-32

    Hardware CRC generators come handy in embedded systems when data or code have to be validated. For example: storing settings in flash or EEPROM, receiving new firmware via a bootloader. Software implementations are either slow (when calculating the CRC directly) or need quite some memory for lookup tables. There are …

    Read more...

  • Coax relay PCB for HF antenna switching

    This is a simple board that switches 4 antennas to a single transceiver. It features SO-239 coax connectors, relays with popular footprints and flyback diodes. Unused antennas are grounded. It can be driven by virtually any controller in the shack.

    PCB top view

    How to get one?

    Gerber files are available here. You …

    Read more...

  • Fast integer scaling on Cortex-M0

    Integer scaling is very common in embedded systems. For example to make human-readable values of ADC readings (correcting for gain or voltage dividers). Two operations are needed to do scaling without using floating-point numbers - multiplication and division. Cortex-M0 is a nice little beast with a single cycle integer multiplier. ARM …

    Read more...

  • Reducing FFT code size of CMSIS DSP

    CMSIS DSP is a fantastic library develeoped by ARM that provides various math primitives (like matrices, filters and FFT). It is usually my first pick when implementing signal processing on microcontrollers bacause it is highly optimized for ARM Cortex-M cores and is free. I was therefore quite surprised when my …

    Read more...

  • Debouncing buttons on EFM32 Happy Gecko

    Button bounce is always a problem for microcontrollers. There are many ways to deal with the issue. The pins can be sampled at a low frequency so that the bounce will settle between consecutive samplings. They can be low-pass filtered in software. Some approaches require the pin to be stable …

    Read more...

  • Beware of JDY-30 Bluetooth SPP modules

    Bluetooth to serial modules have been around almost forever. Just connect power, ground, RXD, TXD, maybe a config pin and you have a trivial way to transmit data wirelessly from an embedded system to a PC or Android device.

    A very common example is the HC-05 module (below):

    HC-05 Bluetooth module

    I remember …

    Read more...