9 ms·
The PIO's really are the star of the RP2040 show, giving it a capability that competing chips like the ESP32 can't match. They are appearing all over the place
by MegaDeKay 2y ago
The PIO's really are the star of the RP2040 show, giving it a capability that competing chips like the ESP32 can't match. They are appearing all over the place in the console hacking space for this reason. Lower power consumption in steep modes for battery-backed applications would be a welcome addition in any V2 version though.
- jsheard 2y agoThings like battery life will probably improve with experience, I was talking to a silicon guy about the RP2040 and they said it's pretty characteristic of a first generation design. The digital logic that can be validated on an FPGA is fine for the most part, but the analog elements are much more difficult to fine tune, hence the poor power consumption, poor ADCs, and lack of internal DACs or opamps in the RP2040, and why the Pico Ws radio is a separate off-the-shelf part rather than fully integrated like it is on the ESP32.
- nimish 2y agoAnalog is large area and expensive in general so sticking to good digital and passable analog is a very good strategy to keep costs down.
- dragontamer 2y agoModern Microcontrollers focus on analog because modern microprocessors start at like $5, maybe even cheaper. If you need digital girth, don't mess with lol 264kB RP2040 systems. Just buy $3 of DDR3L RAM (aka: 128MB) and run Linux for goodness sake. --------- Even ESP32 is a glorified Bluetooth/Wifi chip first and everything secondary. You have to have a niche at this price point to be competitive. RP2040's niche is the 264kB of SRAM, but not much else. It needs a bunch of external parts before it can become a reasonable solution as well, so its not really cost optimized IMO.
- immibis 2y agoYou can't run Linux on DRAM. You need a CPU.
- dragontamer 2y agoYou can't run anything on an RP2040. There's no Flash or code space. RP2040 sits at an awkward placement. It requires external parts, but low end SPI parts and not the nicer proper RAM like DDR3L or the like. ------ My point is that if you have a design that fundamentally requires external parts like the RP2040, the accurate comparison is against MPUs. Chips that are specifically designed to work with powerful and cost effective external components. -------- Analog-focused designs like ATMega, ESP32 or STM32 comfortably do things that the real computers or MPUs cannot do. Like read a voltage, work with OpAMPs or other analog stuff that cannot fit on a proper Linux computer chip like SAM9x60D1G. And to do so without any external parts, so that you have the simplest design possible.
- floxy 2y agoGlad you mentioned Microchip. The PIC32MK family is MIPS architecture microcontroller, with hardware floating point unit, running at 120 MHz, with a whole slew of peripherals, like 10 MHz unity-gain op-amp, D/A converter, lots of flexibility in mapping peripherals to pins, fast A/D, DMA, etc.. https://www.microchip.com/en-us/products/microcontrollers-and-microprocessors/32-bit-mcus/pic32-32-bit-mcus/pic32mk https://www.microchip.com/en-us/products/microcontrollers-an...
- makapuf 2y agoESP32 chips also need external SPI Flash, and many STM32 have little flash and QuadSPI with execute from external flash capabilities, so I don't see this as a specificity of RP2040.
- orphea 2y agoSome ESP32 chips have in-package flash, e.g. ESP32-C6FH4.
- dgacmu 2y agoThough it's a continuing puzzle to me why ESPs have worse ADCs than the rp2040, given their relative maturity. (Neither is particularly good, mind you, but I'm generally ok with the rp for my toy applications.)
- datameta 2y agoSpeaking of relative maturity, I just had a heap corruption debug for a few days. Imagine my surprise when fixing the issue involved switching from the default ESP32 BLE library to the NimBLE library...
- Ballas 2y agoI have been having an intermittent issue as well, but only when using BLE, so I was suspecting the Espressive drivers. I was wondering if it would be worth switching over to NimBLE, so thanks for that tip, I'll try it out and see if the problem goes away. Luckily, it's a very low priority.
- rkagerer 2y agoIf you read through errata and compare editions of the tech docs, it becomes apparent ESP32 has a history of silicon problems with its ADC's - through a few generations of their chips. In some models they removed huge swaths of related functionality from their documentation because it was bugged. They're slowly getting better but analog is hard and I suspect they haven't prioritized it as much, historically.
- baybal2 2y ago[dead]
- konstantinua00 2y agohe said?
- triyambakam 2y agoI was thinking about this. I think there is a trend in English to use they even when the gender is known to indicate a kind of distance from that person. E.g. my guess about the parent poster is that they (he or she in this case, a different usage) may not be very close to the "silicon guy"
- nsteel 2y agoI don't think this is the case. Isn't it that "guy" is essentially gender neutral in this context? In the same way you can reasonably say "hi guys" to greet people of any gender. "Silicon person", "silicon gal" etc would be weirder phrasing. "Silicon specialist" maybe but I don't personally think any of this merits discussion.
- trealira 2y agoMaybe it's used neutrally in greetings (e.g. "Hi guys,") but when referring to someone specific, if you say they're a guy, it will generally be assumed that person is a man.
- nsteel 2y agoThere's no maybe about it. And it goes beyond greetings. But I do agree it was non-sensical here
- trealira 2y agoYou're right, people do use it neutrally in greetings, not just maybe. And in more than greetings, more as a general form of address. More specifically, I would say that when not used to address multiple people in the second person (i.e. when saying "you guys"), then the word "guy" implies that the referent is male.
- 15155 2y agoThe vast majority of real, commercial MCUs do not have WiFi in-package. The ESP32 is unique in this regard and is one of its only redeeming features. I would rather buy the RP2040 and the NRF7001/NRF7002 for the same or less total cost and have a substantially better wireless solution (5.4GHz WiFi 6).
- dvdbloc 2y agoWhere can I learn more about how they are used in console hacking? This sounds very interesting
- nereye 2y agoOne use case is related to the Nintendo Switch, as mentioned in another post. E.g. see https://github.com/Ansem-SoD/Picofly https://github.com/Ansem-SoD/Picofly.
- MegaDeKay 2y agoHere you go. There might be more but these are all I can think of off the top of my head. Nintendo Switch modchip - PicoFly: https://github.com/rehius/usk https://github.com/rehius/usk. That is the OG source of the firmware behind the already mentioned https://github.com/Ansem-SoD/Picofly https://github.com/Ansem-SoD/Picofly OG XBox Modchip - Modxo: https://github.com/shalxmva/modxo https://github.com/shalxmva/modxo (see initial impressions from ModzvilleUSA at https://www.youtube.com/watch?v=uUsov3i6jL0 https://www.youtube.com/watch?v=uUsov3i6jL0) XBox360 NAND reader / writer - Picoflasher: https://github.com/X360Tools/PicoFlasher https://github.com/X360Tools/PicoFlasher (used in the RGH3 hack for some versions of the console as described at https://consolemods.org/wiki/Xbox_360:RGH/RGH3 https://consolemods.org/wiki/Xbox_360:RGH/RGH3) Gamecube Modchip - Picoboot: https://github.com/webhdx/PicoBoot https://github.com/webhdx/PicoBoot Gamecube Optical Drive Emulator - Flippydrive: https://github.com/OffBroadway/flippydrive https://github.com/OffBroadway/flippydrive as described at https://teamoffbroadway.com/ https://teamoffbroadway.com/
- mewse-hn 2y agoThe flippydrive is such a nice, clean install on a gamecube that it leaves me wondering if the rp2040 could make better ODE's for every other console (psx, saturn in particular)
- MegaDeKay 2y agoInterconnecting the flippydrive by squeezing a flex PCB between the optical drive and its motherboard connector was a stroke of genius.
- JAlexoid 2y agoComparing ESP32 to RP2040 is like comparing oranges to apples. If you need a lot of IO - you're probably not looking at ESP32. It's just cheap and has WiFi builtin. There are many options for other MCUs, that compare favorably to with RP2040... though majority aren't for the hobbyist market.
- vardump 2y ago> There are many options for other MCUs, that compare favorably to with RP2040 That's pretty interesting, could you list some?
- jayyhu 2y agoThe STM32 F0/G0/C0 lines come to mind. More I/O, more peripherals and built-in flash. For hobbyist levels, buying 1-10 pcs they are comparable in price to an RP2040 + SPI flash. However at volume pricing, the STM32 MCU's can be cheaper than just the RP2040 itself. I do think Raspberry Pi needs to figure out volume pricing if they want to be competitive for anything that's not just hobbyists.
- Johanx64 2y agorp2040 is 64cents @ 1000qty, thats a good price, compatible winbond 16mbit flash is 12cents. You need to go up way above a dollar to get comparable specs, given the unique nature of rp2040, two cores with fairly high clock, 264kb sram, pio. The only thing i dont like about rp2040 is the package, not hobbyist home soldering friendly for custom board designs.
- SeanCline 2y ago> not hobbyist home soldering friendly for custom board designs I assume by home soldering friendly, you mean too small. I'll make a case for why this isn't a bad thing... If it's difficult to solder a QFN package, then it will be equally difficult to solder the passives and flash it requires. Its price, availability, and good documentation make up for the package by creating an ecosystem of cheap boards hobbyists can use instead. For example, I designed a keyboard around the Solder Party RP2040 Stamp (https://www.solder.party/docs/rp2040-stamp/ https://www.solder.party/docs/rp2040-stamp/). It integrated all the difficult components in a package that fit between the arrow keys and delete key.
- moffkalast 2y agoDitto for robotics. 8 PIO units are enough to read and log four quadrature encoders at practically no interrupt cost, so it's possible to build a perfectly performant closed loop controller in something as slow as Micropython.
- Teknoman117 2y agoYou don't even need the 8 :), 4 quadrature inputs will fit on one PIO block. Some lovely person got a quadrature decoder into 24 instructions, so you can potentially still do something useful on the same PIO block if you only need one or two quadrature encoders.
- moffkalast 2y agoI mean yeah one block is 8 units right? Two pins per encoder which both need a unit each.
- Teknoman117 2y ago4 units per block, 2 blocks per RP2040.
- 05 2y agoMany, many cheap MCUs have peripherals that can decode quadrature in hardware. E.g, PCNT on ESP32, timer modes on STM32 etc. Might as well use PIO to implement I2C or UART :)
- fest 2y ago> Might as well use PIO to implement I2C or UART :) PIO actually came in handy for me when interfacing with an x-ray sensor which had 12 or 14 bits long UART data frame- not many micros have such a flexibility in their UART peripherals.
- moffkalast 2y ago> PCNT on ESP32 Damn TIL, never heard of that. I'll have to try it, thanks!
- crote 2y agoThe most annoying part about the PIO is that there are only two of them (though with 4 sub-units each), they only have space for 32 instructions, and they don't have an external clock input. They are great for implementing very basic peripherals, but more than once I've started to implement something more complex just to realize it would be unacceptably slow and run out of space. If they were to beef them up just a little, they could easily replace the more trivial FPGA applications.
- 15155 2y agoAdd a $2.80 ICE40 with built-in NVM and your problems are solved.
- crote 2y agoConsidering the RP2040 is only $0.70, not exactly an attractive option.
- 15155 2y agoIf an RP2040 doesn't fit the task because it has a pitiful amount of IO, you're now into using two anyway. Two chips, two SPI flashes, two crystals - likely more than the FPGA. If it matters for the task, that FPGA will be able to achieve nanosecond-order IO/clock-to-clock skew times - PIO is painfully bad at this (and is executed serially.) If the task will fit FlexIO's restrictions, the NXP IMXRT1011 at $1.70 blows away the $0.70 RP2040 in basically every metric.
- boznz 2y agoAvailability is the star of the show for me. One IC, long product lifetime, always in stock, after the shitshow that was 2021/2022 I'm not going to bother trying to shave a few cents to compromise this again.
- jsbdudh 2y agoThe RP2040 was only available during the last component shortage, since it was a newly released design, not yet implemented in many products. The IC will be unobtainable in the next shortage, too. I mean, don't you remember the shortage before where even capacitors were only hardly available?
- petre 2y agoDon't worry. No one is bothering with it outside of the hobbist market because it needs an external SPI flash chip, which one cannot protect by programming fuses. Your code is left unprotected, the Chinese can easily clone your product and put millions of units on the market. The ESP chips are a better pick even with all the bugs involved. It's quite typical of the Chinese manufacturers to have like 30 models of some product and release a few new ones every few years. The ESP is no different.
- 15155 2y agoExternal SPI flash can be encrypted on-the-fly with most real commercial MCUs - the issue is that this was not designed to be a commercial MCU for use in products. Relative to other offerings, it's pretty nice (not a fan of ESP32 Xtensa or their new RV32 offerings - ARM chips are so much better) as a DIY/hobbyist/open source chip.
- nkozyra 2y agoDon't cycle sleeps help on the esp32? I typically run on power but I know a lot of people get all day with wifi on reasonable LiPo
- Brusco_RF 2y agoNo love for NXP in this thread? They make a very similar peripheral called FlexIO [1] on devices like the K32. >[FlexIO is a] Highly configurable module providing a wide range of functionality including emulation of a variety of communication protocols It is extremely capable! I have used it to hack together an octo-SPI... which stretches the definition of the S in SPI ;) [1] https://www.nxp.com/docs/en/supporting-information/FTF-ACC-F1179_Introduction_to_FlexIO.pdf https://www.nxp.com/docs/en/supporting-information/FTF-ACC-F...
- 15155 2y agoThe NXP IMXRT1011 is $1.70 from CN and much more powerful/featureful than any of the more-expensive K32 chips, by the way.