Where I use the Labrador to test a different way of implementing Blink on the RP2040 using timer().
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.
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)
Where I begin to work with the Adafruit Feather RP2040 (Feather) and MicroPython (uP) and use the Labrador to test the board.
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.
A short entry to explain how to code using MicroPython on the ESP32.
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.
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.
Where I continue to use the Labrador to test the PWM functionality of the ESP32.
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.
Where I use the Labrador to test specific functions of the ESP32 running MicroPython.
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.
Where I investigate using MicroPython on the HUZZAH32.
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.
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.
Where I find a much, more evolved version of ESPForth. While investigating a bug I found in ESPForth (now called ESPForth6), I ran across a new version of ESPForth 7.0, which I’ll refer to as ESPForth7.
Each time I used ESPForth6, I would experience a bug with the word “constant”.
So I began to investigate ESPForth. Arduino-Forth who had been using FlashForth has now begin to investigate it. Which led me to the sites above. The good news is that I downloaded the ino file for ESPForth 7.05 and it compiled and loaded the first time.
Where I write an Arduino program to test pins on a specific board in order to confirm a Forth HAL for the same board.
When writing software which will control a circuit, it is best to confirm the behavior of circuit using known or familar test software before attempting to write with a new language. For example, I am developing a HAL/Primitive/User layer for the ESP32 using ESPForth. As the board, the Adafruit HUZZAH32 has an Arduino framework already developed for it, it is a good idea to test the board using the Arduino C++ code before testing it with the ESPForth words.
Where I realize something important about using test equipment!
The Labrador has a great price given its performance as a piece of test equipment. However, like all test equipment, it is important to understand and use it properly for testing any circuit. If the circuit under test isn’t responding properly, always check the test equipment along with the circuit.
In this case, I expressed a concern below that “At first, I thought I was finding the same issue as what I had with the Forth HAL version. Specific pins were failing the tests. However, what is happening is that the test i.e; HIGH to LOW, would take 10-12 seconds, while LOW to HIGH would take less than a second.”
It is an interesting approach, however, it doesn’t lend itself well to measurements. I wouldn’t recommend it as a piece of test equipment, it might prove interesting as an IoT approach.