Where I expand on creating a web server application on a Pi Pico W by incorporating web sockets.
In the first part of this entry, I introduced the ability to develop an HTTP-based web server using solely HTML to control the Pi Pico pins. I focused on HTTP protocol as you can write everything in the relatively simple language, HTML and it works. I used checkbox or radio button inputs to a form to control pins on the Pico. This is a far more simple approach than using JavaScript. It does introduce some significant delays as each form submission must make a complete round trip (i.e. a page reload).
Where I demonstrate an enhanced on-board shell for RP2040 (Pi Pico and Pi Pico W) using MicroPython, upysh2.py.
While Thonny can be a bit cumbersome if you already know Python, it does have advantages in being able to provide fundamental file management capability. Its helpful to be able to copy files, list files and folders on the Pico, delete files and rename them. Its biggest issue is that a hardware reset will disconnect the board and reconnecting with the board, causes the board to soft reset. Which prevents you from easily running a main.py program via reset. I have also tested this using the new Arduino Lab for MicroPython and it suffers from the same problem. Very disappointing.
Where I begin to develop a web server for the RP2040 (Pi Pico and Pi Pico W) using MicroPython and microdot.
The Pico W added wireless capability to the Pico, which brings the ability to network the Pico board. Once a board can be networked, it becomes valuable to have it serve web pages. An HTTP-compliant web page is a simple first step to using the Pico W via a network.
A set of entries which comprise a course for learning how develop MicroPython programs for the RP2040.
Where I illustrate how to establish a wireless connection using the Pi Pico W.
When the Pico W was introduced, there was finally a great product from Raspberry Pi to compete with the ESP32. The ESP32-based products are good, however, I prefer the Pi Pico-based products due to superior support and documentation due to its ARM Cortex-based architecture. The Pico W added wireless capability to the Pico, which brought the ability to network the Pico board. It also added bluetooth, which will be a different tutorial.
Where I develop multiple versions of blink to better understand the timing API and bit-setting hardware API in the Pico C SDK in learning how to program the Pico in C.
The Pi Pico family of microcontroller boards have an incredible price/performance ratio. Ranging in price from $4 to $10, the Pico can provide a low-cost, high-performance dual-core Cortex M0-based board with or without wireless or installed headers (for easy breadboarding).
Updated: Feb 27, 2023: Where I install the tools and frameworks necessary to develop code in C on the RP2040 on a macOS platform.
Just as I did for the Linux platform, in this entry I’ll work through the steps required to be successful with developing code in C for the RP2040 on the Mac. Updated: This entry has been tested on both an Intel 2018 MacBook Pro and a M1 2020 Mac Mini.
Where I share various observations as to how to use the Pico with the Arduino software framework and the legacy (~1.8.19) Arduino IDE.
While most RP2040 boards will have a Reset button, the Pico does not. Why? To save costs. It also has a micro-USB connector instead of a USB C connector for the same reason. The single best way to ensure your Pico uploads properly (or more accurately) the Arduino IDE uploads to the Pico, properly is to press and hold the Boot/Sel button then unplug and plug-in the Pico. This can be required a great deal when testing I2C and the unplug/plug-in is a bit of a pain.
Where I explore how to use the Pico’s abundance of I2C interfaces to create 2 separate I2C instances.
I have been using the Arduino framework and legacy IDE (1.8.19, not the 2.0 version) to develop code on the Raspberry Pi Pico. The Pico is an incredible board, well worth using due to its outstanding price/performance ratio. For only $4, you can buy a very powerful, very well documented and easily available microcontroller. With the addition of the Arduino framework, it makes using the Pico a simple decision for a lot of Uno projects..
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.
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. |
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.