feature article
Subscribe Now

Who needs a Raspberry Pi Microcontroller Chip? Maybe You

Amazingly Capable Microcontroller From an Unexpected Vendor, Now in Stock

Many semiconductor vendors including TI, NXP, STMicroelectronics, Microchip, and others play in the microcontroller market. As with nearly every semiconductor niche, microcontrollers have been getting bigger and badder for decades. In the 1970s, there were 4-bit microcontrollers for VCRs and other simple consumer electronics. There were scads of 8-bit microcontrollers, soon followed by 16-bit microcontrollers. Motorola Semiconductor (later renamed Freescale and eventually purchased by NXP) developed the 6801, 6805, 68705, 68HC08, 68HC11, 68HC12, and 68HC16 microcontroller families with literally hundreds of variants in each family. These days, 32-bit microcontrollers are very common.

Motorola Semiconductor was by no means unique among microcontroller makers. Microcontroller variants from every chip vendor seemed to proliferate like bunny rabbits, and every microcontroller vendor offered its own proprietary architectural flavor – or multiple flavors. When it was founded in 2002, Renesas consolidated a bunch of Japanese microcontroller architectures that originated at Hitachi, Mitsubishi, and, eventually, NEC. Then Arm started to pursue the microcontroller market, and, in a decade or so, put all those proprietary microcontroller processor architectures out to pasture.

Microcontrollers are not glamorous parts. They’re not made with the latest lithography. They don’t require exotic packaging or chiplet assembly. They don’t burn 100 watts. Given that, you might think they weren’t a critical part of the silicon menagerie. Make no mistake. Microcontrollers are critical members of the silicon ecology.

When I wrote “How Long Will it Take for the Chip Shortage to Ease?” last October, I specifically chose a photo of a vast sea of Ford pickup trucks spread across the scenery as being a characteristic snapshot of the shortage. Those trucks were awaiting microcontrollers. Microcontrollers are not the thoroughbreds of the processor world; they’re the workhorses.

Well, there’s a new microcontroller vendor in town and it wants your business. Further, it’s got enough semiconductor dice on hand for 20 million parts. You’ve very likely heard of this vendor. It’s Raspberry Pi. And they’re ready to sell you microcontroller chips by the reel through Raspberry Pi Direct at 70 cents each for a reel of 3400 devices. Just want one? That’ll be a buck, please.

Raspberry Pi has named its microcontroller the RP2040. It’s the same microcontroller found on the Raspberry Pi Pico board, which the company introduced last year. Already, there’s a software development ecosystem including an IDE, a C/C++ compiler, a MicroPython interpreter, and a TensorFlow Lite machine-learning framework built around this “new” microcontroller. The company has already sold 1.5 million Pico boards. That’s what you expect from Raspberry Pi.

How much microcontroller do you get for a buck? (And how much don’t you get?) It’s well worth a look.

Here’s a block diagram of the Raspberry Pi RP2040 microcontroller:

First, I have to say this. You’re getting a lot of microcontroller for a buck. This is a 32-bit, dual-core microcontroller with 264 Kbytes of on-chip RAM and an excellent assortment of peripherals typically found in a microcontroller. It’s also important to note what you’re not getting. There’s no on-chip Flash EEPROM, so program code needs to be stored somewhere else when power is off. This may seem like a great inconvenience compared to other microcontrollers with on-chip Flash for program and data storage, but it does allow you to put a large amount of program memory into your design with an 8-lead NAND Flash SOIC. On the negative side, the Flash chip is likely to cost more than the microcontroller.

The RP2040 can execute code directly from its internal RAM or from external memory (RAM or ROM) connected through a dedicated SPI, DSPI, or QSPI interface. A small instruction cache improves code-execution speed “for typical applications” when executing code from external memory, according to the manual. Also, the RP2040 has no built-in Ethernet or wireless capability. Those limitations notwithstanding, this is a very capable device.

It’s apparent from the design and from the company’s marketing materials that Raspberry Pi developed the RP2040 microcontroller to serve as a faster, more capable processor where you might otherwise use an Arduino. Were I in marketing at Raspberry Pi, I’d possibly be throwing the word “powerful” around with abandon, but I’m not. So, I won’t.

The heart of the RP2040 microcontroller is the deal-core processor, which is based on a pair of Arm Cortex-M0+ processor cores capable of running as fast as 133 MHz. These are 32-bit microprocessor cores that use an Arm Thumb compressed instruction set for superior code density. One significant point: these processor cores have no L0 instruction cache, so instruction cycle time is deterministic when executing code from on-chip RAM. You need that determinism for precise I/O control in many microcontroller applications. Back in the day, all microcontrollers featured deterministic instruction cycle times, but times have changed. The RP2040 is old school on this point.

There’s one more notable feature of the Arm Cortex-M0+ processor cores in the RP2040: they have hardware multipliers. That’s an important feature if your application is going to need any amount of mathematical calculation. It’s also very handy for Machine Learning applications.

The RP2040’s peripheral complement includes:

    • Two UARTs
    • Two SPI controllers
    • Two I2C controllers
    • Sixteen PWM channels
    • A USB 1.1 controller and PHY, with host and device support
    • Two PIO blocks

Most of these peripherals should be familiar to you, but the last item, the PIO blocks, likely isn’t. Each of the two PIO units is a small I/O controller, consisting of eight unidirectional FIFO memories (four input and four output), four complex state machines, a 32-entry instruction memory shared by the four state machines, and an interrupt controller. The four state machines simultaneously execute programs from the PIO unit’s shared instruction memory. There are only nine PIO instructions, and Raspberry Pi incorporated a PIO assembler into the RP2040 microcontroller’s SDK.

The PIO units’ FIFO memories queue data transferred between the PIOs and the rest of the RP2040 microcontroller system. GPIO pin mapping logic allows each state machine to observe and manipulate as many as 30 GPIO pins.

What can you do with these PIO units? They can be used to generate precise waveforms and can support a variety of existing I/O standards, including:

Emulating the 8080 and 6800 parallel bus protocols

    • I2C
    • 3-pin I2S
    • SDIO
    • UART
    • DPI or VGA (using a resistor DAC)

PIO programming can be assembled directly by a human programmer, drawn from Raspberry Pi’s PIO library, or generated programmatically by the application software. I am certain that a cult following will grow up around these PIO units.

There’s a lot more crammed into the RP2040’s 56-lead QFN package. I’ve hit only a few highlights to pique your interest. I recommend downloading the 654-page data sheet and taking a look. However, the RP2040 silicon is not even half of the story. The real attraction, to me, is the existing ecosystem already surrounding this device. In addition to the software tools mentioned above, there are several low-cost, finished boards incorporating the RP2040:

These small boards, and many more based on the RP2040 microcontroller, are also available from Amazon, for somewhat higher prices. Many are included in Amazon’s Prime shipping program, so you could be programming an RP2040 in a day or so, if you wished. It’s a convenient, low-cost way to dip your toe into the microcontroller world.


Leave a Reply

featured blogs
May 24, 2024
Could these creepy crawly robo-critters be the first step on a slippery road to a robot uprising coupled with an insect uprising?...
May 23, 2024
We're investing in semiconductor workforce development programs in Latin America, including government and academic partnerships to foster engineering talent.The post Building the Semiconductor Workforce in Latin America appeared first on Chip Design....

featured video

Introducing Altera® Agilex 5 FPGAs and SoCs

Sponsored by Intel

Learn about the Altera Agilex 5 FPGA Family for tomorrow’s edge intelligent applications.

To learn more about Agilex 5 visit: Agilex™ 5 FPGA and SoC FPGA Product Overview

featured paper

Achieve Greater Design Flexibility and Reduce Costs with Chiplets

Sponsored by Keysight

Chiplets are a new way to build a system-on-chips (SoCs) to improve yields and reduce costs. It partitions the chip into discrete elements and connects them with a standardized interface, enabling designers to meet performance, efficiency, power, size, and cost challenges in the 5 / 6G, artificial intelligence (AI), and virtual reality (VR) era. This white paper will discuss the shift to chiplet adoption and Keysight EDA's implementation of the communication standard (UCIe) into the Keysight Advanced Design System (ADS).

Dive into the technical details – download now.

featured chalk talk

OPTIGA™ TPM SLB 9672 and SLB 9673 RPI Evaluation Boards
Sponsored by Mouser Electronics and Infineon
Security is a critical design concern for most electronic designs today, but finding the right security solution for your next design can be a complicated and time-consuming process. In this episode of Chalk Talk, Amelia Dalton and Andreas Fuchs from Infineon investigate how Infineon’s OPTIGA trusted platform module can not only help solve your security design concerns but also speed up your design process as well.
Jun 26, 2023