When I got my first microcomputer, I already knew Basic programming. My machine had a different Basic dialect from the one I’d learned at school, and there was a stack of graphics and sound functionality to get to grips with too, but it wasn’t long before I felt I’d mastered the high-level stuff and that it was time to move on to machine code. That’s how I’ve come to feel about the Raspberry Pi Pico’s RP2040 chip. The time’s right to learn ARM assembly programming on the Pico.
Last year, at the recommendation of a work colleague, I grabbed one of my spare Raspberry Pi 4s and installed the DNS proxy and content blocker Pi-Hole. It’s now handling all the DNS queries on my home network. Recently, I upgraded my Pi-Hole server to make its DNS requests over HTTPS.
One of the reasons why an embedded application developer might choose to build their code on top of a real-time operating system like FreeRTOS is to emphasise the event-driven nature of the application. For “events” read data coming in on a serial link or from an I²C peripheral, or a signal to a GPIO from a sensor that a certain threshold has been exceeded. These events are typically announced by interrupting whatever job the host microcontroller is engaged upon, so interrupts are what I’ve chosen to examine next in my exploration of FreeRTOS on the Raspberry Pi RP2040 chip.
While documenting Twilio’s in-development Microvisor IoT platform, I’ve been working with FreeRTOS, the Amazon-owned open source real-time operating system for embedded systems. Does FreeRTOS work with the Raspberry Pi Pico’s RP2040 chip? I wondered. It turns out that it can, and this is how you set up a very basic FreeRTOS project which also serves as a demo.
My Raspberry Pi Pico-based Motorola 6809 emulator uses the RP2040’s built-in serial-over-USB functionality to receive machine code sent from a host computer. The 6809 and its support code is written in C, but can you make use of the same process under Python? Yes, you can, and here’s an easy way to do it.Continue reading
Do you need to transfer data to and from a Raspberry Pi Pico, or similar RP2040-based board, connected to your computer by USB? Here’s a neat way to achieve it without any tedious mucking about with the USB stack. Apart from a couple of questions on the Raspberry Pi Forum, there’s not much in the way of documentation, so here’s a write-up.
In part one, I described an IoT demo setup based on the Raspberry Pi Pico and the Waveshare Pico SIM7080G Cat-M1/NB-IoT cellular add-on board, and wrote about some of the design goals. Now it’s time to implement that design with some C++ code: a host application, drivers for the modem, the HT16K3-based display and the MCP9808 temperature sensor, and some third-party libraries to decode incoming commands formatted as JSON and encoded in base64 for easy SMS transmission.Continue reading
To turn the Raspberry Pi Pico into an Internet of Things (IoT) device, you need to add wireless connectivity. I thought I’d give it go, to see how straightforward it might be to connect the Pico to cellular networks and have a bare-metal app written in C++ run the show. For a modem, I chose to use Waveshare’s suitably sized Pico SIM7080G Cat-M1/NB-IoT.Continue reading