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
Oct 5, 2022
This year's Jasper User Group is coming up later this month on October 19th and 20th. Once again, we are back in person (I'll be there!) on the Cadence campus. There will also be a 3-hour webinar available before the event to provide an introduction to formal techni...
Oct 4, 2022
We share 6 key advantages of cloud-based IC hardware design tools, including enhanced scalability, security, and access to AI-enabled EDA tools. The post 6 Reasons to Leverage IC Hardware Development in the Cloud appeared first on From Silicon To Software....
Sep 30, 2022
When I wrote my book 'Bebop to the Boolean Boogie,' it was certainly not my intention to lead 6-year-old boys astray....

featured video

PCIe Gen5 x16 Running on the Achronix VectorPath Accelerator Card

Sponsored by Achronix

In this demo, Achronix engineers show the VectorPath Accelerator Card successfully linking up to a PCIe Gen5 x16 host and write data to and read data from GDDR6 memory. The VectorPath accelerator card featuring the Speedster7t FPGA is one of the first FPGAs that can natively support this interface within its PCIe subsystem. Speedster7t FPGAs offer a revolutionary new architecture that Achronix developed to address the highest performance data acceleration challenges.

Click here for more information about the VectorPath Accelerator Card

featured paper

Algorithm Verification with FPGAs and ASICs

Sponsored by MathWorks

Developing new FPGA and ASIC designs involves implementing new algorithms, which presents challenges for verification for algorithm developers, hardware designers, and verification engineers. This eBook explores different aspects of hardware design verification and how you can use MATLAB and Simulink to reduce development effort and improve the quality of end products.

Click here to read more

featured chalk talk

Hot-Swap and Power Protection -- Mouser Electronics and Analog Devices

Sponsored by Mouser Electronics and Analog Devices

When it comes to our always-on, critical systems we need to carefully consider power protection and maintainability. In this episode of Chalk Talk, Amelia Dalton and Dwight Larson investigate the issues that surround hot-plugging into an energized power supply, the best solutions to consider, what the different hot-swap circuit topologies look like for a variety of applications and why the MAX15090B/C with its innovative current foldback startup may be the best solution for your next design.

Click here for more information about Maxim Integrated MAX15090B/MAX15090C Hot Swap ICs