M0AGX / LB9MG

Amateur radio and embedded systems

  • Making graphics and fonts for embedded systems

    Microcontroller systems with graphical displays require a way to display text. In case of alphanumeric displays (like HD44780) it is easy - just send your ASCII bytes to the display. Graphical displays operate on individual pixels so firmware must generate the graphics and texts on the fly.

    In this post I …

    Read more...

  • Waveshare ePaper display library

    I bought a pair of ePaper displays from Waveshare with the intent to use them in a wireless sensor network for displaying slowly changing data. The reference code from Waveshare is quite clunky and not so easy to re-use so I made my own small, portable graphics library and display …

    Read more...

  • Hard fault in __libc_init_array

    When starting my STM32 makefile project for the first time I encountered a very early hard fault in the startup code. It happened exactly when calling libc function at

    1
    2
    /* Call static constructors */
        bl __libc_init_array
    

    The whole startup code came straight from ST so I did not suspect it …

    Read more...

  • STM32L151 makefile project

    I have published a basic Makefile project for STM32L151 on Github. I plan to develop it into a low-power wireless sensor network using SP1ML modules. The modules contains STM32L151RB MCU with 128K of flash, SPIRIT1 transceiver chip, antenna and passive components. Basically everything needed to make an 868MHz radio network …

    Read more...

  • Reading OBD2 data without ELM327, part 2 – K-Line

    K-Line is another popular OBD2 interfacing standard, that has been used in European cars before CAN bus became common. There are a couple of physical variations (K-line, K+L, KKL) and slightly different protocols (KWP2000 or Keyword Protocol, and ISO 9141) running on those lines. Basically all you need to …

    Read more...

  • Reading OBD2 data without ELM327, part 1 - CAN

    All modern cars have an OBD2 diagnostic connector that allows reading many engine and drivetrain parameters like RPM, vehicle speed, temperatures etc.

    Most of car interfaces use a special protocol translating chip like ELM327 or STN1110 to convert different vehicle protocols (that depend on the age and brand of the …

    Read more...

  • FreeRTOS on Kinetis E Cortex M0+ : easy porting tutorial

    FreeRTOS is a popular, open-source operating system that can run on a variety of microcontrollers. This post shows how to make a minimal working setup with two tasks on a new MCU without starting from a complete demo code or code generators (like Processor Expert) on an inexpensive development board …

    Read more...

  • XMEGA power down mode for battery powered devices

    This post describes how to implement firmware-controlled device power switching on an XMEGA. I am working on a portable device that is powered from a Li-Ion cell, has an USB socket for charging, MCU, couple of LEDs and a button. I wanted to keep the design as simple as possible …

    Read more...

  • Kinetis - relocating variables to upper SRAM

    NXP Kinetis microcontrollers have an inconvenient architectural feature - split RAM. The memory is split into two areas of equal size. You can run into this issue when the size of all RAM variables (data+bss) approaches half size of available SRAM. It manifests itself with a linker error looking similar …

    Read more...

  • Practical NodeMCU endurance with a big NiCd battery pack

    Some time ago I have built a WiFi thermometer with a NodeMCU and a 6Ah recycled nickel-cadmium battery. WiFi is probably the least power-efficient communication methods but I was curious how long could a NodeMCU run from a big battery pack.

    It took some time to get meaningful data... voltage trace

    After …

    Read more...