Wellys Dev

  • Home
  • Search/Topics
  • Writings
  • About

    2022

  • 2022-04-19
    Comparing Board and Language Speeds

    Where I compare the execution speeds of different combinations of boards and languages. I will continue to update this post with other languages and processor combinations.

    Table for the impatient

    ucontroller/Speed(MHz) Method* frequency Language
    ATSAMD21/48Mhz Integral .6kHz CircuitPython
    ATSAMD21/48Mhz Integral function .7kHz CircuitPython
    ATSAMD21/48Mhz Library .7kHz CircuitPython
    RP2040/133Mhz Integral function 1.0kHz CircuitPython
    RP2040/133Mhz Library 1.44kHz CircuitPython
    ATmega328/16MHz struct/function pointer 6.1kHz Arduino C++
    ATmega328/16MHz words in an infinite loop 27KHz FlashForth
    ATmega328/16MHz struct/function pointer 55kHz C
    ATmega328/16MHz struct/function pointer 56kHz Arduino C++ w/ native toggle
    ATmega328/16MHz Assembly language toggle 108kHz FlashForth
    ATmega328/16MHz Assembly language toggle inlined 444kHz FlashForth
    RP2040/133Mhz struct/function pointer 578.7kHz C
    RP2040/133Mhz words in an infinite loop 2.841 MHz Mecrisp Forth
    *See text for an explanation of method.

    Introduction

    While writing about CircuitPython and the FIDI board, I was curious as to the execution speed of CircuitPython on a extremely powerful (relative to the AVR ATmega328) ARM M0+ microcontroller. The M0+ is a modern RISC 32-bit processor with a considerable amount of memory, while the ATmega is 20 year old RISC 8-bit processor with a limited amount of memory. That said, one can’t run CircuitPython on ATmega processors, one must use C or Forth.

  • 2022-04-18
    Developing CircuitPython for the FIDI

    Where I go into detail as to how I develop code in CircuitPython for the omzlo FIDI board.

    Omzlo FIDI

    Technical details

    • Small!: it measures 25.4mm x 22mm (1" x 0.86")
    • Microchip ATSAMD21E18A 32-bit Arm Cortex M0+ running at 48MHz, with 256KB flash, and 32KB RAM
    • 4MB flash for CircuitPython code and other files
    • Six GPIOs, featuring SPI, I2C, UART, Digital/Analog IO, PWM, …
    • 3.5mm terminal block connectors and one 4 pin QWIC/STEMMA QT connector
    • 3.3V logic level, maximum 200mA
    • USB micro connection to PC
    • User-controlled RGB LED

    Pinout

    Pinout of omzlo FIDI

    Large Version to see detail

  • 2022-04-11
    Circuitpython on the omzlo FIDI

    Where I evaluate an interesting prototyping board using CircuitPython.

    Sources

    • omzlo FIDI
    • Github Repository for this entry

    Introduction

    I ran across this board, the omzlo FIDI via an Adafruit blog article. I was struck by its size and utility along with its relative powerful processor for its size. From the webpage:

    • Microchip ATSAMD21E18A 32-bit Arm Cortex M0+ running at 48MHz, with 256KB flash, and 32KB RAM
    • 4MB flash for CircuitPython code and other files
      Photo of omzlo FIDI

    Large Version to see detail

  • 2021

  • 2021-06-13
    RP2040 MicroPython Coding Setup

    Where I explain my process for developing code on the RP2040 board.

    Sources

    • MicroPython
    • CircuitPython

    Python User (Discussion below)

    • Sublime Text or your favorite code editor
    • macOS Serial

    Background

    When developing software for microcontrollers, the longtime standard was the Arduino. It required a modified version of C++, which allowed writing software quite close to the hardware, however, it had two specific issues. One, the language itself is very particular and it is not elegant and two, the compile/load/run (CLR) loop can be laborious and time-consuming.

  • 2021-06-10
    RP2040 Blink Continued

    Where I use the Labrador to test a different way of implementing Blink on the RP2040 using timer().

    Sources

    • Raspberry Pi Pico Python SDK

    Background

    I started reading the Python SDK above and noticed this example on page 12.

    Its a method of blinking the LED in the background, which allows the processor to do other work. Let’s try it and see how well it works using the Labrador.

    Code

    from machine import Pin, Timer
    
    led = Pin(13, Pin.OUT)
    tim = Timer()
    def tick(timer):
        global led
        led.toggle()
    
    tim.init(freq=50, mode=Timer.PERIODIC, callback=tick)
    Labrador app showing Blink using Timer
    Serial app showing Blink using Timer

  • 2021-06-08
    Introducing Adafruit Feather RP2040

    Where I begin to work with the Adafruit Feather RP2040 (Feather) and MicroPython (uP) and use the Labrador to test the board.

    Using Blink Test to Confirm Board Works

    Using an Interactive Pin Test to Confirm Header Works

    Sources

    • Adafruit Feather RP2040
    • Raspberry Pi RP2040 Getting Started
    • RP2040 Datasheet
    • Arm: Raspberry Pi RP2040: Our Microcontroller for the Masses
    • Get Started with MicroPython on Raspberry Pi Pico
    • Raspberry Pi Pico Python SDK
    • MicroPython RP2 Docs
    Adafruit Feather RP2040

    Background

    After being disappointed with the uP development for the ESP32, I thought it would be fun to try the latest and greatest, hottest, just out of design, the Raspberry Pi RP2040 Microcontroller. I was able to secure two Adafruit Feather versions and will use those to test.

  • 2021-06-08
    ESP32 MicroPython Coding Setup

    A short entry to explain how to code using MicroPython on the ESP32.

    Background

    In my introduction to Micropython, I mentioned how I wrote MicroPython for the ESP32 on a Mac. As I stated, Phillip van Allen has a nice process, however I like my process more. This entry will review how I develop code as it might be helpful to others.

    Mac Process

    Serial Monitor

    I use a paid application called Serial for serial communication with devices. There are free products, however, I found when using Serial, I’m more productive and I’m able to setup custom settings for each device to maximize throughput while taking care of the idiosyncrasies of each device. I’m also able to connect and disconnect Serial from the device easily and quickly, which is why my approach works so well.

  • 2021-06-07
    Testing MicroPython with the Labrador: PWM

    Where I continue to use the Labrador to test the PWM functionality of the ESP32.

    Sources

    • Makeability Lab Lesson 3: Fading an LED with PWM
    • ESP32-GetStarted: PWM
    • MicroPython PWM
    • Espressif: LED Control

    Background

    We continue to use the Labrador to evaluate how the HUZZAH32 operates. In this case, we’ll dive into how to use the H/W PWM functions as compared to doing it in software.

    The PWM functionality is called LEDC by Espressif, the manufacturer of the ESP32. This stands for LED control and it works quite well for fading, controlling brightness etc of an LED. That said, we can understand it far better if we observe the signals using the Labrador.

  • 2021-06-06
    Testing MicroPython with the Labrador: Blink

    Where I use the Labrador to test specific functions of the ESP32 running MicroPython.

    Sources

    • Quick reference for the ESP32
    • ESP32-GetStarted
    • Adafruit HUZZAH32
    • ESP32-DevKitC I think this is the same as the HiLetGo version I have
    • ESP32 Makeability Lab

    Background

    The best way to begin to understand a board is to play with it. In more technical terms, this means writing software and learning how the board responds. The higher the capability of the board, the greater the need for examining the board with high functioning tools. In our case, we are going to keep things very inexpensive, however, extremely capable and powerful.

  • 2021-06-05
    MicroPython

    Where I investigate using MicroPython on the HUZZAH32.

    Background

    I have spent quite a few years using Python to develop applications. I like the language, however I believed it wasn’t a good candidate for microcontrollers. Given the strong development behind both CircuitPython and MicroPython, I though it would be a good idea to test it and determine via testing and not assumptions.

    Sources

    • Micro Python on ESP32 (HUZZAH32)
    • Getting Started on ESP32
    • MicroPython
    • MicroPython Documentation

    Getting Started

    I followed the steps Wolf Paulus provides on his website and had no problems. I am using macOS Big Sur with the Apple native USB drivers. Which means I’m using /dev/tty.usbserial-01F4D567 and not /dev/tty.SLAB_USBtoUART. I haven’t had any problems…yet.

Page 2 of 2
Copyright © 2025 Lief Koepsel
  • Home
  • Search/Topics
  • Writings
  • About