 This week's Ion MPI brought to you by DigiKey and Aideford is from Raspberry Pi and it's juicy. It's juicy. The RP2040. It's delicious, yes. Finally we've actually been waiting for this to drop and we've been anticipating the RP2040 on Ion MPI from Raspberry Pi. It's their first microcontroller chip and we featured Maxim and ST and Analog and Atmel and Microchip and all those people and they're wonderful. We love them but we also want to give some love to Raspberry Pi because they have finally released the chip that is in the Pico and so many development boards that we can call the RP2040 development board series. You can now get that chip so you, the viewer, can make your own RP2040 boards. So this is what it looks like. It's called the RP2040 and this is the same chip. Right now there's only one chip and it's the same chip that you can find in the Raspberry Pi Pico so you can see the center there. I mean I think part of me believes that like half of the reason they made this chip is just because they wanted to see their logo on the microcontroller because like that's fricking, wouldn't that be cool to have like an Aideford logo on the microcontroller? Yeah. Maybe one day. One day. All right. It's also in our feather RP2040 which by the way we open source the design so if you're looking for like a core that you can use that's like a, you know the Raspberry Pi Foundation actually looked at it and it kind of like fixed all the little mistakes I had so if you want like a design that's ready to go that you can copy the schematic or layout even for a known working RP2040 design, check out the feather RP2040 and of course you can fit on very small boards like the QDPI 2040 here as well. And best of all it's one dollar which is a great deal. It's a good price for microcontroller as powerful as this one. So it's a dual Cortex M0 and it's running really fast, it's 130 megahertz. It's got a ton of RAM but it doesn't have any flash, we'll talk about in a little minute. One thing to note and just because you know people who are wanting to use this in their designs, this is a 0.4 millimeter pitch QFN 56 I think, it's, I haven't had a lot of problems with bridging but it is a fine pitch chip so definitely this is not an easy hand solderable chip. You kind of can hand solder especially with some hot air and some flux and some paste. Really you definitely need to have a custom PC before it so it's something to watch out for. This isn't a dip chip or even like a large SOIC that you can like use as your first microcontroller. Hopefully eventually they'll design a version that has bigger pads maybe or you know it's fewer pins and larger pads but at this time right now it's only available in one package the QFN 56 with 0.4 millimeter pitch spacing. The name is, designates what's inside of it which I think is interesting because it sort of implies that there might be other configurations. So the two is a number of cores, remember it's a dual core, the zero is the M zero core which is, you know it's a very popular ARM core text, 32-bit core, we've seen it in the SAMD 21, of course STM32F1X series is the Cortex M zero, Nordic makes a bunch of the NRF 51 series is the Cortex M zero. Cortex M zero is very very popular, it's a very easy to use chip, ARM GCC has great support for it. It doesn't have DSP or floating point support, if that's something you need they do have some helper functions in the ROM for floating point so it's not like as slow as doing it in pure software, however it just doesn't have SIMD, it doesn't have, you know floating point doesn't have DSP, if that's important to you and it's not going to have to be in software this chip isn't for you. Next up is the RAM, so this is where it's interesting, so there's a ton of RAM, this has a 264K of RAM which is a lot of RAM for a Cortex M zero, usually these kinds of chips have like 16K maybe 32K, this has a ton which is great if you need to like buffer it, you know, a camera or a full display or a TFT or whatever you need a lot of RAM, this chip has got you and it's all contiguous as well and then finally how much flash is in it, and like I said these have zero flash on board which means you're going to have to add another chip externally to add flash. Here's one of the things built in, so the Cortex, the SRAM, the multi-function GPIO, I'll show you the pin map, six pins are required for the execute and place external flash memory, there's built-in hardware for the most peripherals you're used to and there's four ADCs, and there are a lot of ADCs, it's the only thing that's kind of like a little anemic compared to some chips but of course you can always connect an SPI or iSQUIRT-C expander and it is 12-bit so you get good quality and of course team USB support with host and device. For the peripherals, this is kind of repeated, there's DMA and all that good stuff from PLLs, the peripherals are two hardware UARTs, two hardware SPIs, two hardware iSQUIRT-Cs, 16 PWM channels and they're split across all of the GPIO. Now one thing you might notice is like well where's the I2S, where's the PDM, where's you know there's a lot of stuff that's usually in the peripheral like rotary encoder management, maybe motor timing control whatever IRDA support. All that would actually be handled by the PIO state machine. I'm not going to get the whole thing but basically it's a mini programmable state machine that you can use to make complicated bit bang patterns so you can do stuff like bit bang DVI or bit bang Ethernet but you're not actually bit bang it because you have this tool that's doing it for you. It's great for NeoPixels for example because NeoPixels are very simple protocol but you have to get the timing perfect. They're great at simple patterns of data that just have to have perfect timing. And this is the internal structure. You can DMA everything back and forward. It's kind of kind of a standard Cortex M0 structure. There's a little bit of on on chip cache for the execute in place because again flash memory is on external chip that's accessed with QSPY. These are all the GPIO. I'm not going to go into all the GPIO and what they all do of course is the debug port. There's crystal. Every pin can be UART, SPI or iSquared C but it's not fully crossbarred. It just means like every other pin is a UART RX. Every other pin is an iSquared C SDSL. You're not going to have like complete free control to assign anything to anything but you're always going to be able to there's like five options for every pin so you always have some configuration that's going to work out for what you want to do. For external memory just factor that into your cost you know you're going to have to have any size you want but I like this 8 megabit QSPY flash from giga device. I like this chip but you know Wingbond makes chips, Adesto makes chips, tons of people make chips. It is required. You really can't use this chip without having external flash memory and also an external 12 megahertz crystal. For firmware there's a lot of options. There's MicroPython, there's Pico SDK, there's lots of examples in C. There's CircuitPython, there's Arduino. So to start don't forget we have CircuitPython support. People are adding their boards. You can go into the boards directory under ports Raspberry Pi. Honestly copying paste something exists and fill out your pin structure and how much flash memory you've got and it'll probably just work. We've got for Arduino there's two ports available. I actually kind of like this this fill power port. It's got a lot of functionality and it works very solidly and it's it's a low level Pico SDK so it's you can still use all the Pico SDK stuff that you know and love inside the Arduino core. So check out this for Arduino support. It's beta but I've been using it with success. And of course Arduino like very recently also released RP2040 support using embed as an underlying core. I've used it a little bit but not as much. However it's exciting and they said that they would be willing to take pull requests as well for boards. So very exciting to have two possibilities there. That's right. You can pick it up for $1 that's $1. Yeah I'll buy that for a dollar from Robocop. And then you sent me a little bit of a video. Okay so this video it's because you can be in all about the RP2040 but this video shows the capabilities of PIO to do like decoding of data, driving an HDMI display natively like there's no encoder in between. You just connect the pins directly to the HDMI cable and it can or DVI cable and it can actually or VGA cable with some resistors and you can mimic a BBC micro computer which is amazing for a dual core cortex M0. I think they overclocked a little bit but not that much. There's a lot of performance and capability you can squeeze out of this by using the PIOs. So I just thought this is a cool demo. So short your roll there. Product 80 there. Get it on Digikey. Yeah they're selling wheels of 500 or 3400. There's two real sizes 7 inch and 13 inch. They're currently out of stock because everyone has them out of stock. However sign up and you'll be notified. I know that the Pi Foundation is pushing more into inventory as much as possible. So sign up you'll be notified and then you can use our designs as your base. Design your own RP2040 board. Let's say I'm piano. Hi on MPI.