38 ms·
Raspberry Pi Pico and RP2040 Microcontroller
- oblib 6y ago$4... that's just sweet!
- stevefan1999 6y agoWith $1 more you can get a Pi Zero (assuming it's stocked) which is comparatively an 800 pound gorilla to Pi Pico, yet Pi Zero is not great for real time job unlike Pico.
- NetOpWibby 6y agoSo you’re saying to buy both.
- stevefan1999 6y agoIt can be. You can use Pi Zero as the master device and leverage the Pico(s) as real time sensor metric collectors. Zero should be powerful enough to handle Prometheus streaming I guess.
- pantalaimon 6y agoPi zero will also consume magnitudes more energy
- numpad0 6y agoStarter kits and with-header variants are always in stock though, it’s just that $5 price is promotional.
- schappim 6y agoSome high level info on the Pico [1]: - New RP2040 microcontroller with 2M Flash - Micro-USB B port for power and data (and for reprogramming the Flash) - 40 pin 21x51 'DIP' style 1mm thick PCB with 0.1" through-hole pins also with edge castellations - Exposes 26 multi-function 3.3V General Purpose I/O (GPIO) - 23 GPIO are digital-only and 3 are ADC capable - Can be surface mounted as a module - 3-pin ARM Serial Wire Debug (SWD) port - The power supply achitecture is pretty simple (you can power the unit from micro-USB, external supplies or batteries) - Buy price is $USD 4.00 - MicroPython & C++ SDK - Pinout Diagram: https://files.littlebird.com.au/Shared-Image-2021-01-21-17-39-47-GVzHd.png - When using MicroPython, the programming model is similar to other boards where you have to unplug and plug back in the board. I hope this is ok on the Micro-USB port. - The isn't currently a version with header pins, so you'll have to add your own, or get one from a Reseller who will mode them for you (like this one [2]). The burried the lede is that Raspberry Pi have created their own silicon (just like that other fruit company). They call their Microcontroller the "RP2040": It boasts some impressive specs: - Dual-core cortex M0+ at up to 133MHz - On-chip PLL allows variable core frequency - 264K multi-bank high performance SRAM - External Quad-SPI Flash with eXecute In Place (XIP) Source: [1] I've had access to prerelease HW and work at: https://raspberry.piaustralia.com.au/products/raspberry-pi-pico https://raspberry.piaustralia.com.au/products/raspberry-pi-p... [2] Maddy (with her steady hands) has hand modded 100 of these: https://raspberry.piaustralia.com.au/products/raspberry-pi-pico?variant=32587824103473 https://raspberry.piaustralia.com.au/products/raspberry-pi-p...
- RL_Quine 6y agohttps://datasheets.raspberrypi.org/rp2040/rp2040_datasheet.pdf https://datasheets.raspberrypi.org/rp2040/rp2040_datasheet.p...
- teraflop 6y agoOh nice, it actually has fully programmable USB device and host modes built in, as opposed to the basic USB-to-serial bridge in an Arduino.
- schappim 6y agoI've put some guides on the Raspberry Pi Pico here: https://littlebird.guide/lessons https://littlebird.guide/lessons The Pico is pretty awesome. Arduino and Micro:Bit need to watch out!
- magicalhippo 6y agoThe programmable IO blocks look very interesting. PIO is programmable in the same sense as a processor. There are two PIO blocks with four state machines each, that can independently execute sequential programs to manipulate GPIOs and transfer data. PIO is highly performant as well as flexible, thanks to a carefully selected set of fixed-function hardware inside each state machine. When outputting DPI, PIO can sustain 360 Mb/s during the active scanline period when running from a 48 MHz system clock. In this example, one state machine is handling frame/scanline timing and generating the pixel clock, while another is handling the pixel data, and unpacking run-length-encoded scanlines. State machines' inputs and outputs are mapped to up to 32 GPIOs (limited to 30 GPIOs for RP2040), and all state machines have independent, simultaneous access to any GPIO. Will definitely pick a few of these up to play with.
- kbumsik 6y agoPIO is definetly interesting stuff. This has its own assembly language (.pio) to program. Custom peripherals can be implemented by using this assembly. Raspberry Pi already provides example programs such as custom I2C, SPI, UART (they are different from the hardware peripherals in the chip), logic analyser, LED controller, and etc[1]. [1]: https://github.com/raspberrypi/pico-examples/tree/master/pio https://github.com/raspberrypi/pico-examples/tree/master/pio
- mrlambchop 6y agoCome in Arduino, your time is up! The VSCode environment is a huge upgrade from the stock Arduino UI and the piggybacking on the Pi as a development platform makes a ton of sense.
- TAForObvReasons 6y agoPlatformIO and the vscode plugin makes for a comfortable development experience for Arduino
- kevinbowman 6y agoWorth mentioning as well that there's a good CLI for Arduino these days, at https://arduino.github.io/arduino-cli/latest/ https://arduino.github.io/arduino-cli/latest/. It's written in Go, and shares config etc with the traditional Arduino UI. I have no affiliation with it, but have used it happily along with vim, and not needed to drop back into the traditional UI.
- mrlambchop 6y agoWell, I was completely wrong! So the new Pi strategy is selling chips. Curious old world!
- kekub 6y agoIn times of IoT I do not get why they do not offer a version with Bluetooth and WiFi. However a nice product that may be able to push the whole microcontroller hobby space forward.
- hhh 6y agoI'm more interested in where they go from here. This is their own silicon, so it's (hopefully) only up from here.
- tehbeard 6y agoPresumably the licence cost on radio chips would increase unit price and this was a bit of a gamble. This is a good first version to validate if their customer base is interested in such a product from them, WiFi/Bluetooth can be on V2.
- theshrike79 6y agoEspecially when ESP32 is a thing. You can grab boards with small LCD screens and battery connectors included for under 10 monetary units.
- hh3k0 6y agoI was curious and looked the ESP32 up, seems as if there are some grave vulnerabilities: https://limitedresults.com/2019/11/pwn-the-esp32-forever-flash-encryption-and-sec-boot-keys-extraction/ https://limitedresults.com/2019/11/pwn-the-esp32-forever-fla....
- mmoskal 6y agoThis exploit is about loading your own code to, and reading existing code from, a locked (encrypted) ESP32 - which is pretty bad, as it lets someone with physical access to a device to replace firmware on it, but also if you store the same secret in flash of devices you ship, someone can take one of them and get the secret (potentially compromising them all). A single secret, shipped to users is never a good security architecture, as we have learned multiple times. However, it's not like this breaks security of your hobbyist projects. OTOH, the RP2040 doesn't even have flash encryption or secure boot. Which I guess makes sense, given that it looks like a first mass produced MCU designed specifically for education/makers/hackers.
- tonyedgecombe 6y agoAt first glance the data sheets look very thorough: https://datasheets.raspberrypi.org/pico/pico_datasheet.pdf https://datasheets.raspberrypi.org/pico/pico_datasheet.pdf https://datasheets.raspberrypi.org/rp2040/rp2040_datasheet.pdf https://datasheets.raspberrypi.org/rp2040/rp2040_datasheet.p...
- qznc 6y agoWhy? What is the strategy behind competing with Arduino?
- schappim 6y agoThey're not just competing with Arduino. They're also making their own silicon!
- solarkraft 6y agoAlso why, though? Why should I use this over an ESP8266?
- ahepp 6y agoARM vs xtensawhatever
- floatboth 6y agoThis doesn't do wireless, so you shouldn't use it over an ESP, generally. What you should use is Nordic nRF52 :) But for things that don't need wireless connectivity, it's pretty cool, the Programmable IO looks very interesting.
- DanBC 6y agoYou can buy an ESP8266 and a bunch of sensor boards from China and you'd know how to connect them up and get them working. This device is for schools, and it's the thing that happens after BBC Micro:Bit and MakeCode, but before full Python on a PC. It will have very much better documentation than a DIY ad-hoc collection of sensors.
- synack 6y agoArduino just announced a new board based on the RP2040. Not competition, collaboration. https://blog.arduino.cc/2021/01/20/welcome-raspberry-pi-to-the-world-of-microcontrollers/ https://blog.arduino.cc/2021/01/20/welcome-raspberry-pi-to-t...
- intricatedetail 6y ago
- taylorfinley 6y agoAside from the amazing Raspberry Pi ecosystem, the big appeal of this chip is for gpio-heavy applications that don't need wireless connectivity. If you need wireless you'd want an ESP8266 or one of its siblings. Of course the history of the Pi Zero and the Zero W suggests they might release a connected version in the future.
- geerlingguy 6y agoThere is ample board space on the Pico... Also note that there are a number of other integrators (Sparkfun, Adafruit, even Arduino) who are making custom boards. I wonder if one of them may even hack in some sort of wireless module.
- intricatedetail 6y agoWhat if mid project you realise you need more I/O? If you choose stm32 for your project you can just choose bigger controller, then you can easily even run your own board. It seems like RPi starts building a walled garden. Not cool.
- uncledave 6y agoYeah I wouldn’t even look at this with STM32 on the market. Much larger choice and plenty of different dev boards available. You can also get FreeRTOS up on an STM board in 30 minutes and actually doing useful stuff.
- geerlingguy 6y agoI got some hands-on time with the Pico and made a video for it [1], with a tiny project I decided to try out with MicroPython. It was the first time I'd ever tried MicroPython, and I have to say I'm a huge fan. As a dev who came from PHP/Javascript into Java and Python (heh, not quite the same thing but that's how life was), I find MicroPython a lot more intuitive than the Arduino language or raw C. I also learned that Adafruit maintains their own flavor, CircuitPython [2]. Definitely worth trying out if you haven't, and know any Python! [1] https://www.youtube.com/watch?v=dUCgYXF01Do https://www.youtube.com/watch?v=dUCgYXF01Do [2] https://circuitpython.org https://circuitpython.org
- djaychela 6y agoI did some micropython for a video series I made [1], and I have to say, it took me right back to the days of owning a ZX Spectrum - accecssing a REPL directly over a USB serial connection was very much like these machines, although I know it's not something that everyone thinks is a good idea... I like the idea that the main interface to the device is to program it in some way or another, and I'm sure that was what led my generation to be as computer-literate as they are. I'm going to order a Pico today! [1] - https://realpython.com/courses/getting-started-micropython/ https://realpython.com/courses/getting-started-micropython/
- deleted 6y ago[deleted]
- amelius 6y ago> it took me right back to the days of owning a ZX Spectrum Is there any kit that includes a screen (with a case) and a small keyboard, and a manual for (say) less than $100? It would be great if there was a self-contained kit that you could give to a child, so that it can have that same "home computer" experience as in the old days. I.e., something like this, but with a modern form factor: https://en.wikipedia.org/wiki/TRS-80#/media/File:TRS-80_Model_3_01.jpg https://en.wikipedia.org/wiki/TRS-80#/media/File:TRS-80_Mode...
- 6y ago
- techdragon 6y agoSo, heres my biggest question, this has 40 pins of IO, are these the same 40 pins of IO as a "normal" Raspberry Pi? I wont be the last to ask this question, so they should really document this so that people don't need to pull up pinout lists and compare them to answer this kind of obvious question. If they are compatible, they should release either a version with all 40 pins on the same side, or an adapter PCB this can be soldered onto. A big part of what makes a RPi boards so useful is the ecosystem of HATs ands Shields that are compatible with the 40 pin header of the Raspberry Pi.
- magicalhippo 6y agoAs can be seen from the datasheet, the pins on the Pico are not the same. You could probably map most of them up, given that the pins on the Pico are flexible. But not sure if that makes much sense, I imagine you'd only need a single UART/I2C/SPI connection between the regular Pi and the Pico in most cases. What perhaps could be more interesting would be a Pi+Pico combo board, where most of the IOs come from the Pico.
- techdragon 6y agoI actually have a few different Arduino Raspberry Pi hybrid boards (a few are passive pin mapping type things, but others are full Arduino boards built to use the Raspberry Pi as a host) and this was the sorts of use cases that had me thinking about pin compatibility.
- nachtigall 6y agoThe complement book "Started with MicroPython" at https://www.raspberrypi.org/products/micropython-pico/ https://www.raspberrypi.org/products/micropython-pico/ looks like a nice present for kids. Would be great if it was available in other languages (for example, german). Anybody knows if translations of the book are planned?
- eb0la 6y agoFor kids? I am over 40 and it's a nice present to me as well :D
- synack 6y agoThe PIO peripheral looks incredibly powerful. State machines connected directly to IO pins!
- Cixelyn 6y agoYeah! Docs start on page 323 here: https://datasheets.raspberrypi.org/rp2040/rp2040_datasheet.pdf https://datasheets.raspberrypi.org/rp2040/rp2040_datasheet.p.... Looks like there's an assembler for programming the PIO peripheral; they seem quite capable with two IO registers and two scratch registers. I've used a similar sort of embedded state machine inside EFM8 microcontrollers before. They're great not just for implementing custom communication protocols, but also for offloading simple tasks: one example I've coded before is that you can offload software key debouncing to the state machine, and even get an interrupt on keypress. This greatly simplifies the main loop as you don't need to dedicate polling time or write debounce calculations!
- synack 6y agoTI's PRU is a similar concept, but the PIO here is simpler. Parallax Propeller also has a similar flavor with lots of small cores doing different things. It's not a new idea, but the PIO looks like a nice balance between capability and complexity. I'm in love with this documentation. It's not just prettier than other vendors' datasheets, it's also got lots of examples, links, tips, and explanations about the "why" in addition to the "how"
- anonymousDan 6y agoCan you give some examples of why this would be useful?
- synack 6y agoAny situation where you have tight timing requirements could benefit from this. The datasheet has several examples demonstrating how the PIO can be used to generate serial clocks based on data output.
- magicalhippo 6y ago
- Rebelgecko 6y agoWhat's the difference between PIO and GPIO?
- magicalhippo 6y agoGPIO = General Purpose IO[1], can be used for bitbanging or via dedicated peripherals like I2C, SPI etc. PIO = Programmable IO, a peripheral unit with programmable state machines that manipulate GPIOs. Can be used to implement SPI or similar protocols. The PIO looks quite interesting, see the datasheet[2] for more details. [1]: https://en.wikipedia.org/wiki/General-purpose_input/output https://en.wikipedia.org/wiki/General-purpose_input/output [1]: https://datasheets.raspberrypi.org/rp2040/rp2040_datasheet.pdf https://datasheets.raspberrypi.org/rp2040/rp2040_datasheet.p...
- Rebelgecko 6y agoThat's awesome, seems like it could be really helpful for interfacing with hardware (or maybe a low power mode analogous to using the ULP in an ESP32?). Sidenote, that's one helluva datasheet, over 600 pages! Great to see such thorough documentation
- magicalhippo 6y agoDatasheet does look nice indeed. It's clearly written to be more approachable, which I like. Though I'd say it's "only 600 pages". For comparison the STM32F417 reference manual is 1700 pages and in addition you need to read the datasheet which is another 200 pages. Not a bad thing though, it has less numerous and less complex fixed peripherals compared to the STM32 family.
- deleted 6y ago[deleted]
- 00deadbeef 6y agoIt's huge compared to the various ESP boards and lacks WiFi or Bluetooth. Costs about the same as a D1 Mini.
- timthorn 6y agoOther vendors are making dev boards based on the RP2040 at different sizes. SparkFun looks to have some smaller form factors, though I can't see wireless listed on board: https://www.sparkfun.com/news/3707 https://www.sparkfun.com/news/3707 Pimoroni has a range of "packs" (rather than Hats) on the way, including a wireless one : https://blog.pimoroni.com/pico/ https://blog.pimoroni.com/pico/
- kingosticks 6y agoThe VGA one (not available yet) looks fantastic https://shop.pimoroni.com/products/pimoroni-pico-vga-demo-base https://shop.pimoroni.com/products/pimoroni-pico-vga-demo-ba...
- whiskers 6y agoThanks! We're really proud of it, and it's a heck of a lot of fun too - there's something a bit magic about running an old VGA monitor off this little piece of silicon. The PIOs allow you to offload actions like outputting the VGA leaving the CPU free to do other things.
- kingosticks 6y agoDo you guys sell a VGA to HDMI adapter? You might need to!
- sdenton4 6y agoAnd that's how the Demo scene came back to life in 2022...
- m01 6y agoThe accompanying blog post [1] mentions the Arduino Nano RP2040 Connect [2], which includes "a highly efficient power section, a powerful WiFi/Bluetooth module, and the ECC608 crypto chip, enabling anybody to create secure IoT applications with this new microcontroller". It also looks quite small. [1] https://www.raspberrypi.org/blog/raspberry-pi-silicon-pico-now-on-sale/ https://www.raspberrypi.org/blog/raspberry-pi-silicon-pico-n... [2] https://blog.arduino.cc/2021/01/20/welcome-raspberry-pi-to-the-world-of-microcontrollers/ https://blog.arduino.cc/2021/01/20/welcome-raspberry-pi-to-t...
- ohazi 6y agoThe Cortex-M0 instruction set has some rather unfortunate limitations [1] that can make it difficult for compilers to generate good code for shared/concurrent data structures. I can understand why they took this route on a first silicon project, but I hope to see a CM3/4 core or maybe even a riscv core in the near future. [1] https://twitter.com/bitshiftmask/status/1337944590251331584?s=19 https://twitter.com/bitshiftmask/status/1337944590251331584?...
- unwind 6y agoThis is a very minor nit, but it's actually a Cortex-M0+ (the plus is significant). Unfortunately the tweet you referenced got that right, so the criticism still stands. See [1] for a short description. I think I knew that the M0+ lacks the regular load/store exclusive instructions from larger ARMs, handy for implementing synchronization primitives ... odd that they've build a dual core then? No idea how that is supposed to work, but haven't checked the docs either. Edit: After browsing the (very nice-looking) RP2040 documents, it seems the only atomic thing on the chip is the special "ghosted" I/O access. That will probably be co-opted to implement atomic data structures, but then it will be at the cost of making access to the actual peripheral whose registers are being "stolen" harder or impossible. Strange, hopefully I'm missing something obvious. :) Also, the PIO peripherals seem awesome! Can't wait to see all the cool things people will pull off with those. The document mentions them being capable of DVI and VGA signalling, even. [1] https://en.wikipedia.org/wiki/ARM_Cortex-M#Cortex-M0+ https://en.wikipedia.org/wiki/ARM_Cortex-M#Cortex-M0+
- TD-Linux 6y agoThere are a couple of FIFO "mailboxes" and spinlock registers between the two cores - I imagine they expect most of the synchronization to happen via that. It is a bit weird of a configuration though - is this the first dual core M0+? Does it count as SMP?
- pantalaimon 6y agoJust disable interrupts while accessing shared data, it's two instructions and the critical section should not be long.
- Havoc 6y agoPrice wise the gap to a zero W is rather small. Fun as this sounds paying a little extra for a full nix environment and wifi is a better fit for me. I can see it being useful for low power applications though
- MarcScott 6y agoI like the idea of using it from an educational point of view. One of the big problems our coding clubs face, when using a Raspberry Pi, is that they need all the peripherals disconnected from their standard PCs and used with the Pis. This way Code Clubs and CodeDojos can use existing IT infrastructure to get their kids into doing some electronics projects, at a very low price.
- makomk 6y agoYeah, from what I can tell the previous Raspberry Pi approach of a completely separate, full-on computer was ill-suited to its stated educational purpose for multiple reasons. The trouble is, the climate of, well, fanboyism around the Pi meant that this tended to be dismissed as an issue. I wonder if now everyone will discover how much better microcontroller-based boards are for this, just like everyone discovered the performance benefits of not having an ancient version of ARM when the Pi 2 came out and the practical benefits of integrated wifi when the 3 came out...
- IshKebab 6y agoThey're not really in the same category though. This is a bare metal microcontroller. The Pi Zero is normally used with Linux. I guess maybe you can use it bare metal but nobody does. A more relevant comparison is ESP32.
- dheera 6y agoEhh there are lots of cases where I'd rather have a microcontroller than a full OS. The biggest thing going for microcontrollers is that they aren't vulnerable to file system corruption if you yank the plug on them, making them extremely useful for IoT devices like smart locks / lighting / air quality monitoring / appliances / electronics designed for use in the field where you don't want to sit around figuring out how to ssh in and type "sudo shutdown -h now" instead of just yanking the plug and get on with your day, which you can do safely with a microcontroller. (Strictly speaking yes you could design an OS for the Pi Zero W that mounts in read-only mode and avoids this problem but it's a headache) That said the Pi Pico doesn't look attractive to me; I usually use ESP32s for those projects these days.
- mytailorisrich 6y agoLet's see the availability of these. The Pi Zero is hopeless in that regards, for some reason.
- dejv 6y agoThere are various new boards using same chip poping out everywhere (Adafruit, Sparkfun...) so availablity should not be a problem here as batch sizes of chips are huge. I am actually looking forward to see what the price of chip is going to be. This might be a great contender to STM32 familly.
- alias_neo 6y agoI just ordered 3 from Pimoroni this morning (3 per user limit). I'd love to be able to buy 3 Pi ZeroW but haven't been able to since the day they were released and I'm loath to pay £2.50+ delivery 3 times to make 3 separate orders.
- mytailorisrich 6y agoIt's limited to 1 per order at the moment, like the Pi Zero. This makes it much less attractive, indeed...
- lmilcin 6y agoThere are already plenty good boards in that format. I have a bunch of STM32Nucleo32s from Cortex-M0 to Cortex-M4 on them. https://www.st.com/resource/en/user_manual/dm00231744-stm32-nucleo32-boards-mb1180-stmicroelectronics.pdf https://www.st.com/resource/en/user_manual/dm00231744-stm32-...
- deleted 6y ago[deleted]
- pjmlp 6y agoI guess Python is definitely the new BASIC.
- guenthert 6y agoI agree, but isn't that already long established? One could argue now whether the original Raspberry Pi did so or the OLPC a number of years earlier.
- deleted 6y ago[deleted]
- Uhrheber 6y agoI bet that future Raspberry Pi boards will have a RP2040 or successor chip onboard, to do the bit banging/realtime jobs on the I/O port. Or they will even integrate it into their SOC. Shame though, that they didn't make the IO ports 5V capable. It's nowadays pretty common for microcontrollers that are meant for industrial and automotive use to have a separate supply for the I/O ports, that can go up to 5V, independent from the core/peripheral voltage. The main use is to drive (logic-level) MOSFETs directly, interface to 5V buses like SENT, CAN, etc. without having to use level shifters.
- magicalhippo 6y agoYeah, would be interesting if they integrated it ala STM32MP1[1][2]. [1]: https://www.st.com/en/microcontrollers-microprocessors/stm32mp1-series.html https://www.st.com/en/microcontrollers-microprocessors/stm32... [2]: https://www.seeedstudio.com/blog/2020/03/10/introducing-new-stm32mp1-microprocessor-for-industrial-iot-improvement/ https://www.seeedstudio.com/blog/2020/03/10/introducing-new-...
- phkahler 6y agoPWM outputs are nice too. For power electronics, center aligned complementary pairs with dead time are a must.
- wiml 6y agoI think that's what the PIO state-machines are for — offloading timing-sensitive I/O logic and waveform generation.
- ex3ndr 6y agoFinaly! hobby-ready-and-popular arm board instead of weird AVR.
- regularfry 6y agoThe limits on the input voltage are a little frustrating. Not being able to go over 5.5v means you can't just strap it to a 2S li-po and drive servos off the pwm outputs. Anyone know how strict that 5.5v limit is, and what's likely to go pop if you gave it 7.4v?
- amelius 6y agoIf you configure the PWM outputs as open-drain, then you might be able to run the servos from a higher voltage than the MCU, depending on how much current the ports can sink.
- regularfry 6y agoYeah, that's at least another part though, even if it is just a regulator to get the 7.4v down to 5v. Just seems like a bit of a miss.
- guenthert 6y agoWith batteries you'll want a buck/boost regulator (DC-DC converter) in any case. At a $4 retail price, that would be a significant share of BOM for a specialized use case. For professional use, nobody stops you from creating such a board, amateurs are better of using a commercial USB power cell (likely more expensive than the Pi Pico though).
- regularfry 6y agoThere's already a buck/boost on the board. It's just limited to 5.5v max. It's also not that specialised, given that we've got people like adafruit advertising that the pwm is for servos, and lithium polymers are a hugely common power source.
- guenthert 6y agoIndeed. The schematic shows a Richtek rt6150b-33gqw, which is a buck-boost converted [1]. I fully would have expected a buck converter or LDO there. Well, pity then. Take it up with the RPi foundation ;-} On the plus side, this should allow you to run the Pi Pico from a single lithium cell on Vbus. [1]https://www.richtek.com/assets/product_file/RT6150A=RT6150B/DS6150AB-05.pdf https://www.richtek.com/assets/product_file/RT6150A=RT6150B/...
- gioscarab 6y agoThe Arduino Team may not be happy about this.
- MarcScott 6y agoI beg to differ - https://blog.arduino.cc/2021/01/20/welcome-raspberry-pi-to-the-world-of-microcontrollers/ https://blog.arduino.cc/2021/01/20/welcome-raspberry-pi-to-t...
- krzyk 6y agoI wonder how much does just RP2040 cost, I assume the board is just to test some stuff and later in a project you just solder in RP2040 + few components to make it work.
- ajsnigrutin 6y agoWhy? Why should I need/buy one? RaspberryPI is a relatively good "PC" for cheap, uses little power and is fast enough for most usecases at home. RaspberryPi zero is a bit slower, but a lot smaller.... and harder to buy. Neither of them have any good alternatives on the market (yes i know many other similar boards exist, but software support is really shitty for those "alternative" boards, especially after a few years). Why PI Pico? What killer feature does it have, compared to esp32 (which has wifi), arduino (which as a gajillion libraries and support), or some other microcontroller (bbc micro, STM,...)? EDIT: not trying to shit on their effort, but genuinely looking for an answer to "why this, and not something else (arduino, esp,...)?"
- pulse7 6y agoUses much less power and comes from Raspberry PI Foundation.
- deleted 6y ago[deleted]
- alin23 6y agoPIO state machines programmable in Python sound pretty neat: > You'll note there's no I2S peripheral, or SDIO, or camera, what's up with that? Well instead of having specific hardware support for serial-data-like peripherals like these, the RP2040 comes with the PIO state machine system which is a unique and powerful way to create custom hardware logic and data processing blocks that run on their own without taking up a CPU. For example, NeoPixels - often we bitbang the timing-specific protocol for these LEDs. For the RP2040, we instead use a PIO object that reads in the data buffer and clocks out the right bitstream with perfect accuracy. Same with I2S audio in or out, LED matrix displays, 8-bit or SPI based TFTs, even VGA! In MicroPython and CircuitPython you can create PIO control commands to script the peripheral and load it in at runtime. There are 2 PIO peripherals with 4 state machines each. [1] Two M0 cores with M4 speeds and priced lower than usual M0-based boards also sounds exciting: > The RP2040 is a powerful chip, which has the clock speed of our M4 (SAMD51), and two cores that are equivalent to our M0 (SAMD21). [1] And official support for MicroPython and USB host and guest for $4 is something rare and could potentially lure some tinkerers into embedded programming. I personally plan to create an USB ambient light sensor for controlling Lunar [2] with it. It is a very affordable and widely available board which could potentially allow people to reproduce the sensor even in places where I can't ship a pre-assembled board. [1] https://www.adafruit.com/product/4864 https://www.adafruit.com/product/4864 [2] https://lunar.fyi https://lunar.fyi
- roland35 6y agoThe PIO (programmable hardware) is the most exciting aspect of this device! I think this might be a key technology differentiator in the future of microcontrollers, especially as the industry settles in on similar cores (ARM Cortex M0/4). Interfacing with weird/custom hardware is often why we need to use microcontrollers in the first place, and this will make it much easier.
- zozbot234 6y agoExcept that the industry is settling on RISCV, for reasons of cost and flexibility. It's quite disappointing that Raspberry Foundation chose a clunky and limited legacy platform like M0+ for this silicon, given their educational mission.
- acdha 6y ago> Except that the industry is settling on RISCV, for reasons of cost and flexibility. Do you have any numbers supporting that? I see a few people on HN excited about it but the shipments are a tiny rounding error on the volume of ARM devices shipping.
- rcxdude 6y agoEh, RISC-V is gaining popularity in some areas but it's very far from settled. ARM is still extremely dominant and it's not likely to go away in the near future. For this class of processors specifically there are basically no competitive RISC-V versions available today, and I would not expect to see any for a few years. I have used RISC-V professionally mainly because it was easier than worrying about licensing a different soft core for an FPGA. I have the same codebase running on an ARM cortex-m3. The RISC-V code uses far more flash and RAM (near 2x for code in flash and stack space in RAM), as far as I can tell because of awkward decisions made by the ISA (there are extensions which should improve this a little but they aren't available in the core I'm using). If it were a cost sensitive high volume application then ARM would win basically on that front alone, the license fees would be more than offset by the cost in hardware.
- kingosticks 6y agoI'm glad they shipped this today, rather than in n years time when RISC-V might be a real option.
- forty 6y agoSorry for the possibility dumb question: do those microcontroller board have some kind of operating system? Is that operating system open source? Could it, in theory at least, run some trimmed down Linux kernel?
- antoinealb 6y agoUsually you don't run an operating system on those, or maybe what is called a Realtime Operating System (RTOS). That's basically glorified thread scheduler, with some basic synchronization primitives. Regarding the Linux question, the larger cortex M devices can, but this one is probably too small at 264 kB, although not very far from the minimum (I could find boards with ~320 kB claiming some support). The biggest question is wether or not the Cortex-M0 architecture has all the required features for Linux (M4 and M7 can, but are much bigger chips).
- numpad0 6y ago1) Your program to run is the operating system. This board has USB bootloader but probably can be erased. 2) Sometimes open, sometimes shared source or sometimes supplied as binary blobs. 3) No, there's not enough RAM, nor there is DRAM interface, nor it has MMU with hardware physical-virtual memory translation that Linux requires. Dmitry Grinberg's "uARM" ARMv5TE emulator[0] might still work if it is absolutely necessary to run Linux on this. [0]: http://dmitry.gr/index.php?r=05.Projects&proj=07.%20Linux%20on%208bit http://dmitry.gr/index.php?r=05.Projects&proj=07.%20Linux%20...
- analog31 6y agoI would actually venture so far as to say that the purpose is to not run an operating system. Programming i/o intensive stuff that has to work in real time, on a computer with an OS can be hard, especially for a beginner. The OS "gets in the way" if you will. A useful approach for applications that need an OS is to run the OS on a regular computer, and connect it to a microcontroller that handles your custom i/o tasks. Connect them via USB or wireless.
- m463 6y agoI was told in school "the job of an operating system is to share resources" and yeah, you don't want to share anything when doing microcontroller kinds of things.
- nfriedly 6y agoThis thing looks awesome! I also love that there are already a couple of feather/thing+ boards available, which means hundreds of pin compatible add-on boards. I am a little bit surprised that they didn't announce a Raspberry Pi HAT to pair a RP2040 with a regular pi. Maybe that's coming soon. (Or, even better, a new pi with one of these alongside the higher-level CPU.
- woliveirajr 6y ago> Due to a logic error, the watchdog counter is decremented twice per tick. Which means the programmer needs to program double the intended count down value. The Pico SDK examples take this issue into account. See RP2040-E1 for more information. Good documentation and, as always, it's kind of "I want no brown M&Ms in the jar". I bet this bug (and many others) will bite someone. [0] https://datasheets.raspberrypi.org/rp2040/rp2040_datasheet.pdf https://datasheets.raspberrypi.org/rp2040/rp2040_datasheet.p... , page 558
- cptskippy 6y agoAny chance that we'll see the larger Pis get custom silicon instead of the Broadcomm SoCs?
- happycube 6y agoEverything from the Pi 2 on are basically custom chips that Broadcom designed under contract.
- mrlonglong 6y agoLooks like they followed in Sophie Wilson's footsteps by designing their own ARM chip! Maybe this will feed into their next iteration of the Raspberry Pi, one hopes?
- las_balas_tres 6y agoThey most likely just licensed the ARM IP.
- ChrisRR 6y agoIt's odd, I can't figure out why they designed their own silicon (obviously not from scratch) I'm guessing they expected to sell so many that they'd recoup the tooling costs.
- Narishma 6y agoThey did not. They designed the SoC but the ARM part is just a regular Cortex M0+.
- varispeed 6y agoThey say "RP2040 microcontroller chip designed by Raspberry Pi in the United Kingdom", but they won't mention where it has been manufactured? So the institution wants to get the praise of being "western", without committing to pay their fair share by hiring local engineers and factories? I understand then the piece wouldn't cost £3.40, but you can't have your cake and eat it, can you? I wish they were more honest about it.
- Quillbert182 6y agoThe chip is made in Japan, according to the comments on the post. However, most of their products sold in the west are made in Wales.
- varispeed 6y agoIn that case, respect! I didn't know. I wish they were more open about it what comes from where.
- buildbot 6y agoWould the PIO state machines support something as complex as FireWire?
- rasz 6y agoFW is self clocked differential 400MHz. Looks too fast, fastest examples I saw so far used heavy overclocking to reach ~130MHz.
- mrlonglong 6y agoHow straightforward is it to swap out the 2MB flash for something larger, say 16MB flash?
- geerlingguy 6y agoOn the Pico itself? Unsure. But Arduino is already set to release a Nano version with the RP2040 and 16 MB of flash [1], so it's probably not crazy hard :) [1] https://blog.arduino.cc/2021/01/20/welcome-raspberry-pi-to-the-world-of-microcontrollers/ https://blog.arduino.cc/2021/01/20/welcome-raspberry-pi-to-t...
- mrlonglong 6y agoI've just ordered two picos. Hopefully they still have some in stock as they're flying off the shelves !
- mrlonglong 6y agoWoo hoo, they arrived today!
- jonhendry18 6y agoThere's a datasheet that covers it. https://datasheets.raspberrypi.org/rp2040/hardware_design_with_rp2040.pdf https://datasheets.raspberrypi.org/rp2040/hardware_design_wi...
- 1024core 6y agoAre there any similar boards with built-in accelerometers and BT5.0?
- ohazi 6y agoA few more interesting observations: It doesn't seem to have any on-chip flash. While this is a common scenario on application processors and FPGAs, this is unusual on a modern microcontroller. It's not really a problem... XIP flash is cheap and ubiquitous... I'm just curious what the reasoning here was. Cost? Process restrictions? Silicon IP licensing issues? Not necessary if 99% of the chips are used on this RPi carrier board? The (hard) boot rom is open source! I honestly can't remember the last time I saw this.
- guenthert 6y agoThe Parallax Propeller has an on-board boot ROM, but no E(E)PROM. Not much an issue for the intended audience (hobby and educational sector it seems), but the delay between reset and program start (while it is being loaded into internal RAM via I2C from external memory) would be for some hard real-time use cases. Something to be aware of.
- lxeiqr 6y agoSo far, it sounds like a pretty good alternative to many other newbie-friendly microcontroller kits (like Arduino). However, for more complex tasks or advanced users, in my opinion, there are better (and cheaper) options, such as ESP8266/ESP32.
- mastax 6y agoMy first impression is that the RPi foundation has finally jumped the shark. There is a vast, vast number of microcontrollers available in every possible configuration. How can this chip possibly differentiate? How is custom silicon necessary to make a microcontroller dev board? How does this support their educational mission? I'm starting to come around. The chip is interesting: it's as if they were listening to my (silent) complaints about the microcontroller industry. Dual core micros exist but dual core, low end, low power is more unique. Having multiple cores can actually simplify firmware since you can dedicate a core to a polling event loop rather than having to design, configure, and debug an interrupt based state machine within the hardware's limitations. The PIO peripherals are very interesting as well and look like a lot of fun. These two features are a half step towards something like the Parallax Propeller. The on board peripherals don't begin to approach the vast quantity and complexity that other manufacturers have accumulated over the years, but the PIO and extra core help to overcome this. The peripheral to GPIO mapping is not quite any-to-any but it is very flexible. The pinout was specifically designed to be easily and logically broken out on a single layer. These issues are near to my heart since I'm in process of fighting to work around ST's almost random pin assignment and inflexible GPIO alternate functions on a much larger chip. ST does seem to be learning, though, with their newer STM32G0 series. As expected the RPi foundation put a lot of work into documentation, both beginner level and the datasheet. The datasheet looks quite good, though it's hard to say if it's better than ST's until I use it in anger. Not having on-board flash feels a bit old fashioned but it's cheap and easy to interface an external SPI flash. As I understand it FLASH can be difficult and expensive to integrate on-die due to the relatively high voltages required for programming (~20V). It takes up a lot of die space and then you need more die space for the programming, read-out, addressing, and control logic [0]. ST's blurb about their manufacturing process always talks about their proprietary on-die FLASH technology which goes to show how big of a manufacturing optimization challenge it is. It makes a lot of sense to avoid for their first chip. The RPi Foundation has always had one foot in the proprietary world. I've excused this before as a necessity required for them to make hardware, and they've done little bits to push the hardware world in a more open direction. I'm still disappointed that this non-profit has essentially created their own "Intel MKL" of optimized subroutines rather than contributing them back upstream. Even the Intel MKL is licensed to work on other compatible processors. It's hard to overstate how limiting it feels to only have one chip available in a microcontroller series. The chip part number explanation in the datasheet suggests that they'll release other variants with different numbers of GPIO, different packages, different number of cores and RAM. The foundation will never approach the breadth of the big boys, however. It helps to be part of the ARM ecosystem where at least the code, core peripherals, and debug interface are portable. It's the rest of the custom peripherals that get you stuck, but using a HAL helps with at least the basic functionality of the common peripherals. Also peripherals and configuration aren't always completely identical across a manufacturer's lineup so you should expect a baseline level of porting effort anyway. So it's a neat chip and I'm glad they're making it. Adding microcontroller-level tech to their curriculum definitely helps their mission, but as the Arduino and BBC Micro:bit have shown it's not necessary to make a custom chip to achieve that goal. It may even be detrimental as students are learning a chip which is less relevant in industry - modulo the mitigating factors in the previous paragraph. However, this is a good first independent project for the RPi chip design team which could be a step towards releasing a better or more open mainline RPi with a fully custom SoC in the future. There's also a point where their volume is so high they don't need that much of a justification. [0]: http://electronupdate.blogspot.com/2018/08/espressif-esp32-teardown.html http://electronupdate.blogspot.com/2018/08/espressif-esp32-t...
- tigrezno 6y agoWhat I wanted: Pi Zero W with buffered/protected GPIO (robust like an arduino) and a few analog inputs. What we got: An Arduino clone... I'll pass on this one.
- dmitrygr 6y agoSo what is the 100ku cost and lead time for the RP2040, or is it only a toy?
- patentatt 6y agoReminds me of the Parallax BASIC Stamps: https://en.wikipedia.org/wiki/BASIC_Stamp https://en.wikipedia.org/wiki/BASIC_Stamp