Stephen Smith's Blog

Musings on Machine Learning…

Assembly Language Tutorial Six for MagPi Magazine

with one comment


Assembly Language Tutorial Six for MagPi Magazine

I’m in the process of writing a series of Assembly Language tutorials for MagPi Magazine. The sixth and final one appeared in issue #121 on page 58.

The PDF version of the magazine is free to download, but MagPi always appreciates any donations.

This article doesn’t look at ARM Assembly Language, instead it looks at the special Assembly Language used by the Raspberry Pi Pico’s Programmable I/O processors. If a CPU needs to handle all the aspects of I/O operations itself, this can take a significant percentage of its processing power. To offload this I/O processing from the CPU, the RP2040 chip includes a set of special PIO coprocessors that can do the I/O processing independently from the CPU. This special Assembly Language is simpler than ARM Assembly Language and there is only room for 32 instructions in the coprocessor, but even so the RP2040’s PIO processor is powerful and can leave the RP2040’s main ARM CPU free to perform more application oriented processing.

Unfortunately this article was written before the Raspberry Pi Pico W was released. The Pico W adds Wifi and Bluetooth to the Raspberry Pi Pico. To do this, Raspberry took over the GPIO pin that connected the on-board LED to the CPU. As a result the program in this article won’t work on a Pico W, only the regular Pico. On the Pico W, the onboard LED is connected to the wireless chip and you have to go through the device driver for this chip to access the LED. There is an example program to do this in the Pico W’s SDK samples.

This tutorial can only give so much detail. If you want more detail, you can always consider my book RP2040 Assembly Language Programming.





Written by smist08

August 25, 2022 at 10:05 am

One Response

Subscribe to comments with RSS.

  1. […] Assembly Language Tutorial Six for MagPi Magazine I’m in the process of writing a series of Assembly Language tutorials for MagPi Magazine. The sixth and final one appeared in issue #121 on page 58. The PDF version of the magazine is free to download, but MagPi always appreciates any donations.  […]


Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.