Apress will release in November the book RP2040 Assembly Language Programming: ARM Cortex M0+ on the Raspberry Pi Pico. Adafruit asked author Stephen Smith some questions about himself and the book:
No, this is my third book on Assembly Language programming, all with Apress. The first is “Raspberry Pi Assembly Language Programming”, that covers ARM 32-Bit Assembly Language including the FPU and NEON coprocessors. The second is “Programming with 64-Bit ARM Assembly Language” including 64-bit Raspberry Pi along with programming Apple and Android phones and tablets. I also wrote two Science Fiction novels: “Influence” and “Unification”, available on Amazon.
I wanted to write a book on microcontrollers or Arduino, but there is such a variety of them, it’s hard to write a book for a large enough audience. Then when the RP2040 was announced, that was really exciting, a full 32-bit dual core processor with lots of memory, PIO and a ton of integrated components, I was really excited. The first board I managed to obtain was an Adafruit RP2040 Feather which worked great. After playing with the RP2040 SDK and experimenting with “thumb” Assembly Language and the PIO, I knew I wanted to write a book and submitted a proposal to Apress which was enthusiastically accepted.
This book is for people that have already mastered at least one high level programming language such as Python or C and now wishes to take their programming to the next level. I think it’s important that programmers know the underlying architecture they are programming and how things work at a lower level. In the microcontroller world, you may need to use Assembly Language to interface to the hardware that is part of your project, or you may need to get the best performance possible out of these powerful little chips.
There is a lot of reference type documentation on the RP2040 and a lot of information on the RP2040 SDK, but reading this isn’t a good way to learn how things work. My book endeavors to teach the low level architecture and Assembly Language programming in an approachable way. To show how to put the individual parts together, how to start simple and combine things to write larger programs. To give a good overview of how the various hardware components are designed and used.
The best background is if you know C or Arduino C, but proficiency with any high level language is fine. The only real way to learn programming is by doing, so you should have an RP2040 board, and I recommend programming it from a full Raspberry Pi.
My favorite chapter is “Chapter 14: How to Connect Pico to IoT” which is the last chapter in the book where we create a larger project to collect data from the RP2040 using its built-in temperature sensor and send it to a Raspberry Pi. In this project we put all the knowledge from the previous chapters to work and produce a useful program 100% in Assembly Language, all talking directly to the RP2040 hardware registers.
The coolest thing I’ve seen is generating VGA output to drive a monitor. I’m starting to see PCBs produced that you can plug multiple RP2040 chips into. I think the PIOs can be used to enhance inter-processor communications. If the RP2040 gets a little faster, then an HDMI driver would be really cool. And of course PIO Assembly Programming is covered in my book.
To start incorporating Assembly Language into your projects, Either to achieve better performance or to get the RP2040 to perform tasks that aren’t supported from MicroPython or C.
I’ll definitely be writing more books, but I haven’t decided what is next. I’m keeping an eye on the RISC-V world, but until they have something equivalent to the Raspberry Pi, I’m not sure if it’s worthwhile. The technology world moves quickly, so my next book could easily be on something that hasn’t been announced yet.
Thank you Stephen for your responses!