In-depth: Raspberry Pi Pico's PIO - programmable I/O!

  Переглядів 126,563

stacksmashing

stacksmashing

День тому

In this video we take an in-depth look into the new Raspberry Pi Pico/RP2040 high-speed programmable I/O system: PIO!
For a high level video check • Raspberry Pi Pico: you... !
I know this video is quite fast-paced and dense, but I'm trying to experiment with different formats for these in-depth videos :)
Errata:
- 8:20 - the register is always decremented, not only if the condition is met
- 9:01 - The pin will be OFF for one cycle and ON for 2 cycles - said it the other way around accidentally
- Luke on Twitter: / wren6991
- Pico PIO examples: github.com/raspberrypi/pico-e...
- C SDK Book: datasheets.raspberrypi.org/pi...
- BBC Micro Emu on the Pico: • BBC Micro emulation on...
Links:
- Twitter: / ghidraninja
- Patreon: / stacksmashing
Timestamps:
00:00:00​ - Intro
00:01:15​ - PIO architecture
00:02:30 - The state machine
00:05:30​ - IO Mapping
00:06:56​ - Set Instruction
00:07:47​ - Jump Instruction
00:09:08​ - Mov Instruction
00:10:23 - In/Out Instructions
00:10:53 - Push/Pull Instructions
00:11:43 - IRQ Instruction
00:12:47 - Wait Instruction
00:13:38 - Delay
00:14:45 - Side-Set
00:15:48 - Program Wrapping

КОМЕНТАРІ: 201
@Wren6991
@Wren6991 3 роки тому
This PIO thing is pretty cool, I should learn more about it
@AlasdairAllan
@AlasdairAllan 3 роки тому
Not sure where that leaves the rest of us Luke. 🤦
@louigi6001
@louigi6001 3 роки тому
Once you get the hang of it :-D let us know ... we will bug you for a step by step tutorial that takes us from the pio blink example to writing our own pio stuff. I'm still really puzzled on the raw C helper function % c-sdk
@AndrewTubbiolo
@AndrewTubbiolo 2 роки тому
Pilot Induced Oscillation is a pretty scary thing to get into. :)
@martandrmc
@martandrmc 3 роки тому
The Raspberry Pi Foundation just lit a fire underneath Arduino. The pico is so packed with features and as such appeals to people that have experience with Espressif's chips while at the same time being more than a quarter the price of an Uno plus being more intuitive. They covered everyone with their hardware, they sure did know what they were doing.
@dieSpinnt
@dieSpinnt 3 роки тому
You know that you are comparing Apples and Ataris, don't you? In addition, it won't do any harm if Arduino burns down. That was a joke, of course. Frameworks burn badly, or not at all, when they are mental constructs;) Don't forget: use the right tool for the right job. In some of the comments here you can clearly see how strange a high-speed logic with discrete building blocks is to people. To know about that too can sometimes be an advantage. Or simply have knowledge besides the Arduino, ESP or Raspberry filter-bubble. www.digikey.com/en/products/filter/embedded-microcontrollers/685 ... Fucking 89483 results!
@martandrmc
@martandrmc 3 роки тому
@@dieSpinnt The AVR market is not going to change, I am just fearful of Arduino's position here. You could get a bare bones AVR chip for a comparable price to the pico even after the demise of Arduino no problem. It would only really show how expensive their stuff are and pressure them to act. Whatever happens, knowledge is knowledge.
@dieSpinnt
@dieSpinnt 3 роки тому
@@martandrmc Hmmmm, I can't see us both discussing the (insert MCU here) Market. Who buys, calls! In retrospect, my thoughts on your Arduino worries to calm you down: If you have to do something quickly, use a BAD editor (I just don't understand why people pick it up. It's a free decision to use a text editor and not code-completion mumbo jumbo or the other way arround) ... in other words: one that works (!) and you want to try something quickly (with thousands of others strengthening your back with their experience through libraries or support), again: something that works ... proven There is always a niche for this type of hobby or craft work. This niche can be really big, so big that even professionals can use it to quickly try out an idea. I think you shouldn't worry. Especially not because of diversity :)
@dieSpinnt
@dieSpinnt 3 роки тому
May I show you something other besides my inabilities of soldering TQFP packages? www.st.com/en/microcontrollers-microprocessors/stm32h747-757.html#overview A powerhouse with camera interface, GPU acceleration and a pin header count that doesn't bring us both to a laughter as the pico. The same free tools and support from an industry leader (let us make jokes, later:)). Raspberry Pi Pico ? I don't see this as god's chip. Don't let you fool from the hype. There are Ten of Thousands out there, if not more ... to choose from. Edit: I cheated a little: for the price of the Pico, you have to give up graphics acceleration but you have up to 160 flexible IO lines .... You can then connect externally via the memory interface, as well as operate quad SPI memory and what works as a PIO there does a DMA controller for normal people. The one described has 4.
@martandrmc
@martandrmc 3 роки тому
@@dieSpinnt In retrospect, comparing the 2 prices is not by any means the full story. There are devboards out there with an STM32 at around the same price as the pico that have better performance than an Uno but still have not gotten to be main-stream yet. Arduino has alot of software behind it that could also work with a Mega if performance is needed. In conclusion i dont think that Arduino is in as much danger as i have thought, but still the pico is backed by a similarly well-known company. It would not be equivalent to compare STMicro the same way. (Also sorry for not checking for a week)
@eFeXuy
@eFeXuy 3 роки тому
Finally! someone talking the PIO. And it has to be our favorite reverse engineer.
@GodmanchesterGoblin
@GodmanchesterGoblin 3 роки тому
I have been around microcontrollers off and on since the MK3870 at the end of the 1970s. Having this level of IO functionality driven by separate execution units with well thought out instruction sets is just mind-blowing in its possibilities. I know other chip families have had smart, programmable IO systems, but this takes it to a new level. As someone who used only to program in assembler for most of the 1980's, I found that this was a great video that explained the capabilities very well. Thanks. Subscribed.
@seancharles1595
@seancharles1595 Рік тому
Me too. I spent five solid years working with 6809,8085,Z80,68K and this video has left my mind reeling with questions like "Yes, but what can/can't you do with it?" I've seen one video of a guy who has recreated the original Transputer boards. I learned Occam for a bit on one of those.
@rubenschaer960
@rubenschaer960 3 роки тому
Currently working on a PIO based project, and this video has been a life saver. I'd love see a video that has more examples of how IO mapping works in practice, especially with overlapping pins. Thanks for the great work!
@suncrafterspielt9479
@suncrafterspielt9479 3 роки тому
A lot of knowledge, nice video. But I could not quite follow without examples
@stacksmashing
@stacksmashing 3 роки тому
For sure quite a dry topic, tried my best to create it as a 'reference' :) Next one will have some practical examples, that should help!
@suncrafterspielt9479
@suncrafterspielt9479 3 роки тому
Ok cool, cant wait for the next video
@frollard
@frollard 3 роки тому
Agreed. as stack says, needs to be a reference first...but would be nice to show a very brief example of an instruction executing (like how the effect on square wave is demonstrated).
@zetaconvex1987
@zetaconvex1987 3 роки тому
It would also help if he slowed down a bit. It's difficult to absorb information when it's blasted at you.
@spotlight-kyd
@spotlight-kyd 2 роки тому
@@stacksmashing Maybe videos are not the best medium for a reference, surprising as that may be in the YT age.
@raulrrojas
@raulrrojas 3 роки тому
This clarifies lots what this board is intended to be, it is not just another microcontroller but a very advanced one. Thanks for the deep explanation
@TheFerdi265
@TheFerdi265 2 роки тому
I recently got a Pico and a VGA drmo board, and I've spent the last few days getting to know all of the nice peripherals the Pico has. This video is a great overview of the PIO!
@DeLaCruzer11
@DeLaCruzer11 6 днів тому
This tie up everything together I've read or watched so far about PIO, but never quite get to breaking that threshold of solidifying my understanding of PIO. But the video did it for me. Great job!
@masonp1314
@masonp1314 3 роки тому
I love assembly language for it being so simple yet so complicated. If I'm programming, I always prefer low level, for some reason.... Yet I hate myself afterwards 😂
@edgeeffect
@edgeeffect 3 роки тому
Assembly language is delicious!
@chonchjohnch
@chonchjohnch 2 роки тому
If you want a good challenge, try implementing string.h
@JyrkiKoivisto
@JyrkiKoivisto 2 роки тому
Coming from Amiga programming background I always find myself reinventing the wheel... :) Love the low level stuff! I haven't watched the whole video yet, but somehow I think that the Amiga co-processor (Copper) has been made to do I/O
@RebelPhoton
@RebelPhoton 3 роки тому
This is the video I've been looking for for the last two months! Thanks! Watching it on loop
@tmkkka8093
@tmkkka8093 3 роки тому
Exactly. It's quite complicated if one is new to assembler. .wrap_target at video start :)
@edgeeffect
@edgeeffect 3 роки тому
After a lot of explanations that are either too vague or too specific, this is a nice concise description of how the PIOs work. Thanks.
@paulmaher5434
@paulmaher5434 3 роки тому
Great video. Been reading around this all week without making much progress. Feel like I am starting to understand after watching this video. Well done.
@WistrelChianti
@WistrelChianti 3 роки тому
Best PIO explanation I've seen so far! Thanks so much. Looking forward to the examples video. I tried to follow the one in hackspace mag but really struggled. I think largely I'm falling down on the buffers and the the shift registers and keep getting lost on what direction things are going relative to what (PIO SM, main cores, or pins/IO). Your diagrams/animations really helped in this video though so thanks for that effort.
@0xTJ
@0xTJ 3 роки тому
Nice to have this video! I've read through the datasheet section, but this helps in visualising how it all comes together
@stacksmashing
@stacksmashing 3 роки тому
Thank you, that's great to hear! :)
@martinrousselle6380
@martinrousselle6380 3 роки тому
WoW !!! exactly to the point , fast paced and covers everything , now when I read the spec. it will make sense ... thanks this is the BEST !!!
@LeoDDJ
@LeoDDJ 3 роки тому
Very concise and visual explanation. I like it very much! It gives a great overview _and_ details
@oskarboer1511
@oskarboer1511 3 роки тому
Great, sounds like an awesome thing to learn asm and how low level stuff actually works. Thanks for the great explanation!
@nithssh
@nithssh 3 роки тому
This video is amazing. Very comprehensive! Thanks for making it!
@piperna5786
@piperna5786 3 роки тому
Love this video, all I wanted to know in a pretty information-dense format
@chrismeggs8795
@chrismeggs8795 3 роки тому
All this bitbanging is great! Takes me back to channel programming IBM/360. What I need now is a slightly higher level helicopter to understand the pico’s application in an architecture dimension.
@coder_rc
@coder_rc 3 роки тому
I literally never seen a raspberry pie nor even I am a hardware guy still understood everything in this video Awesome work! Gonna watch your all hardware videos!!!
@y2ksw1
@y2ksw1 Рік тому
Thanks, this overview helped a lot to clarify some concepts.
@gustavkusnir483
@gustavkusnir483 Рік тому
Around 8:25, JMP (X--), the documentation says: JMP X-- and JMP Y-- always decrement scratch register X or Y, respectively. The decrement is not conditional on the current value of the scratch register. The branch is conditioned on the initial value of the register, i.e. before the decrement took place: if the register is initially nonzero, the branch is taken. (RP2040 Datasheet, page 320,321) The emphasis is on ALWAYS so that the decrement is ALWAYS done.
@mandelbro777
@mandelbro777 Рік тому
awesome explanation. these 8 PIO's will be super useful.
@DigitalJedi
@DigitalJedi 8 місяців тому
I absolutely love PIO in my chips. It means you can hook up just about anything you want, unconstrained by physical ports or dedicated controllers. It's almost like a tiny FPGA on your chip. My ultimate goal is to get multiple RP2040s running as a cluster using their PIOs.
@ryanj4274
@ryanj4274 3 роки тому
Outstanding explanation! Now I just need to get my hands on one...
@alexhirsch889
@alexhirsch889 3 роки тому
This is amazing. Thank you for the effort you obviously put into this (and your other) videos.
@tav9755
@tav9755 2 роки тому
Very good introduction into this interesting topic. Thanks for sharing
@deBaer
@deBaer 3 роки тому
Very well-made and informative video, thanks!
@MrEdwardhartmann
@MrEdwardhartmann 3 роки тому
Thanks - I have been waiting for someone to make this video - you got my sub! I modified the ws2812 RGB example in the python code to work with sk6812 RGBW leds, and it was really hard to find any good examples of exactly what the PIO assembly instructions were doing. And even less info on what the python calls to that code was doing. I hope you will cover this in your future videos. Thanks for all your work.
@magiceireann
@magiceireann 3 роки тому
I took this at a high level but thank you for bring this to my attention
@turtius
@turtius 3 роки тому
wow, that was a fantastic video! _marlin 2.0 might be able to run on this_
@stal1963
@stal1963 3 роки тому
Excellent explanation. Thank you for this video! I reduced the speed of the video to 75% though which helped me watching the video in a more relaxed manner 🙂
@tmkkka8093
@tmkkka8093 3 роки тому
You know it's the creme de la creme when you go 0.75 speed :)
@chinoto1
@chinoto1 2 роки тому
Meanwhile, I'm watching at 1.5 and not fully processing everything. Oh well, I'm just trying to get the gist of it and I'll look at documentation when I'm actually working with it.
@zyxwvutsrqponmlkh
@zyxwvutsrqponmlkh 2 роки тому
​@@chinoto1 Lel, I had to jump down to 1.5 from 3.5; video speed controller is my best plugin.
@Xperimenter
@Xperimenter Рік тому
This was very clear, thanks!
@devnol
@devnol 3 роки тому
I like how this was released the same time as Rpf's video that explains PIO (but simply what it is, not how it works).
@lohikarhu734
@lohikarhu734 2 роки тому
Quite a bit like the lighting control 'engines' that in the LP5523 LED controller (ca.2006), but maybe without the engine priorities(?), although the pin mux idea is similar. this allows for some pretty fast real-time functionality, without needing cpu intervention, and with a LOT of flexibility. (BTW, if you do need an LED controller that doesn't need you to constantly execute code to do complex LED functions, the LP5523 was designed to offload the cpu, and allow LED functionality when the cpu is in deep sleep, even has an "interrupt" input/output to respond to, or initiate, other hardware functionality.)
@elektron2kim666
@elektron2kim666 4 дні тому
Great run through.
@vamshioruganti6319
@vamshioruganti6319 2 роки тому
Great video, Thanks for your efforts, It is very useful.
@krystostheoverlord1261
@krystostheoverlord1261 2 роки тому
Oooo, this is very interesting! Could be cool to use the pio to hook up some picos together, honestly now I am super excited to get my hands on a batch;
@MichaelKingsfordGray
@MichaelKingsfordGray 2 роки тому
Thank you, sir!
@grumpybollox7949
@grumpybollox7949 3 роки тому
this video is very helpful
@larsmuldjord9907
@larsmuldjord9907 Рік тому
Currently looking into implementing i2s audio using the PIO sm's. It's easy enough to imagine "how to do it" in my head. But I have a hard time grasping "the right way". Been watching videos and read up on the documentation. Some stuff confuses me, some makes sense. This video was helpful, although I did miss some examples for some of the instructions and the whole concept of mapping certain pins to PINS are still a bit confusing to me. I'm a visual guy, so I definitely got more from the first part of the video with the visual aids. Great video nonetheless. :) Thanks. EDIT: Btw, one thing I am having a very hard time with, is trying to connect my data in my C / C++ code with whatever the sm reads / works on. That whole IRQ, DMA, FIFO, ISR, OSR situation makes my head explode. :D It's probably simpler than it seems. I just need to slowly work my way into it.
@tanvach
@tanvach 3 роки тому
This is some smart engineering!
@gcm4312
@gcm4312 3 роки тому
this is awesome
@bryansiepert9222
@bryansiepert9222 3 роки тому
Great info and great animations :)
@csbluechip
@csbluechip 3 роки тому
Nice job! Thanks :)
@m1geo
@m1geo 2 місяці тому
Really cool, thanks!
@dougjones468
@dougjones468 3 роки тому
extremely helpful!! i had to play @ 3/4speed because i am from southern US and i listen as slowly as i speak)) i have posted question on rpi-forum about feasibility of pio-state-machines to implement canbus (would need external differential drivers), but sadly no answers. Please reply with opinion if you are familiar with canbus. many thanks for well done vid.
@fourhorsesltd3788
@fourhorsesltd3788 2 роки тому
I can't thank you enough for this video, it is very clear, very well structured and very detailed. All other 'tutorials' I've seen pretty much say "PIO is really powerful, you can do amazing stuff. Here's an example of how to flash the on board LED. Work everything else out for yourself".
@edgeeffect
@edgeeffect 3 роки тому
After you've come through the assembly language door with PIO you can carry on down the rabbit hole and program the ARM cores in assembly too!
@sn0wst0rm
@sn0wst0rm 3 роки тому
I love your channel so much and I really want to learn how to use ghidra, I really hope you’ll make more learning videos because I love this field and you can teach concepts and methods really well in my opinion, keep it up please, every video from you is a blast!
@kaki9927
@kaki9927 3 роки тому
I always really enjoy watching these videos but afterwards I feel like I know nothing xD
@DeepspaceHorizon
@DeepspaceHorizon Рік тому
This is actually what i have been waiting for, if i understand it correctly. Thanks for this video! Do i get it right that i can read 8 bit in parallel by only one state machine and write it into memory via dma while data is being transferred via wlan from memory, and all this runs concurrently?
@philrod1
@philrod1 2 роки тому
This [stacksmashing] thing is pretty cool, I should learn more about it
@txd
@txd 3 роки тому
Wow amazing video :D
@yahmk3978
@yahmk3978 3 роки тому
Thank you!
@Grazfather
@Grazfather 3 роки тому
Great vis. How did you make these animations?
@agniveshadhikari
@agniveshadhikari 3 роки тому
So basically, my processor gave me a bunch of more complicated processors for free, and now I have to learn them. Great. /s
@xmine08
@xmine08 2 роки тому
Crazy level of presentation my dude! Also, PIOs were the thing that made me interested in the Pico - I'm not even an embedded developer. However, with the Shift Register and its capabilities alone the possibilities are crazy ♥
@kumarbhatia6566
@kumarbhatia6566 3 роки тому
Very good but very fast in the discussion. Have to rewind and listen a few times to digest the topics. 8:59 example for JMP is documented in reverse? First the output will be OFF and then ON for 2 cycles? Please confirm.
@schwellhaimbassriot2660
@schwellhaimbassriot2660 3 роки тому
mal kurz weg vom nüntändö, hehe. didn't know that you can do so naice stuff with pio - fantastic.
@BashingDinosaurs
@BashingDinosaurs Рік тому
Thanks, cool video. Can the PIO instructions read analog inputs?
@mr.unbekannt2163
@mr.unbekannt2163 3 роки тому
Nice to have this video! This helps me to realize my project. But I don't understand the state machine, because from the UML perspective this is not really a state machine. A state machine must have an entry point and transitions between states, including conditions. The exit state is optional.
@peter9477
@peter9477 3 роки тому
Not sure where you're getting that definition. If it's from UML, then they've redefined the term. A state machine doesn't need an exit point. And it certainly doesn't need transitions defined between every state (if that's what you meant there). I've built many no-exit state machines, and almost none with all possible transitions allowed.
@mr.unbekannt2163
@mr.unbekannt2163 3 роки тому
@@peter9477 de.m.wikipedia.org/wiki/Zustandsdiagramm_(UML) im Vergleich dazu der de.m.wikipedia.org/wiki/Endlicher_Automat
@peter9477
@peter9477 3 роки тому
@@mr.unbekannt2163 I'm not sure what you're expecting me to get from that page. Are you claiming something in it contradicts me? Or are you claiming that the UML definition does require all possible transitions to be allowed? (In which case as I said they have redefined the term, and inappropriately, I might add.)
@RussTanner
@RussTanner Рік тому
Fantastic video - very well done. Do you have a followup video to this? I cannot find it on your channel.
@fred-9929
@fred-9929 Рік тому
Thanks for this PIO introduction! I now understand what I read in the datasheet ;o) I have a question: as IN and OUT pins groups can overlap, how are common pins handled? Do they automatically change direction depending if they are shifted in or shifted out? I'm asking because I would like to interface the Pico with a Z80 bus, so IN and OUT should point to the same pins...
@davidsuzukiispolpot
@davidsuzukiispolpot 11 місяців тому
I just stumbled upon this and am blown away by this feature. I wanted something like this in the past and was considering programmable logic. Does anyone know which other processors have this feature? Maybe the raspberry Pi computers?
@LittleRainGames
@LittleRainGames 3 роки тому
So wait this runs separate from the main code? Man this micro is unbelievable, I want to switch to this, but not sure about the IDE, and Id need to be able to purchase chips.
@TheJaguar1983
@TheJaguar1983 9 місяців тому
This reminds me a lot of the code in Shenzhen I/O.
@GottZ
@GottZ 3 роки тому
This is sooo nice! Imagine someone would create a gameboy cartridge with it xD
@stacksmashing
@stacksmashing 3 роки тому
Someone did! www.reddit.com/r/raspberry_pi/comments/lhym1v/gameboypico_update_we_have_a_working_game_but/
@stylesoftware
@stylesoftware 2 роки тому
Can you do a vid on software tooling and first examples? Seems a lack out there in youtube land, we are all super keen to get PIOing!
@patrickcs
@patrickcs 3 роки тому
Great video. I would love to have this as a document. I’ll run through this slowly and make a lot of notes. It’s very useful. I’d love to know where you got the data from .
@zakz1586
@zakz1586 3 роки тому
Datasheets I presume
@_laxman_vijay
@_laxman_vijay 5 місяців тому
datasheets.raspberrypi.com/pico/pico-datasheet.pdf
@AZOffRoadster
@AZOffRoadster Рік тому
I was surprised to see Pi make this product. What, no linux? I'm in. It reminds me of bit slice programming on the AM2900, or the TPU on the 68332, or Motorola DSCs, or even EPROM based state machines. Now I just gotta think up an application.
@michael-rommel
@michael-rommel 3 роки тому
Hi, I think there is another errata to be written: at 7:37 and 14:04 you explain, that "set pins, 1" turns an output ON, whereas at 9:01 you explain it as turning it OFF. Or did I misunderstand something here? Thanks for the great video - that was well-paced with dense information!
@stacksmashing
@stacksmashing 3 роки тому
You are absolutely correct, great catch! It's off for 1 cycle and on for 2 cycles. Added it to the errata. Glad you liked it!
@ikocheratcr
@ikocheratcr 3 роки тому
I really like this feature in RP2040, I wonder how they come up with it. Is there any other microcontroller that has something like this?
@brycem8161
@brycem8161 3 роки тому
Cypress' PSOC series have fpga like programmable hardware blocks builtin.
@edgeeffect
@edgeeffect 3 роки тому
It's like a more accessible version of the Parallax Propeller.
@lawrencedoliveiro9104
@lawrencedoliveiro9104 3 роки тому
8:28 The Motorola 68000 family had an unusual decrement-and-branch instruction: instead of decrementing and branching until the count reached zero, in which case it would stop branching and fall through (existing the loop), it would decrement to -1 before exiting. This let you deal easily with the case where the loop count was initially zero, in which case you want to just jump over the loop completely. E.g. move.w #count, d0 bra loop_end top_of_loop: .... body of loop ... loop_end: dbra d0, top_of_loop
@lukamarin9622
@lukamarin9622 4 місяці тому
So had the Z80: 'djnz address', which stands for Decrement and Jump if Not Zero, where register b (8 bit) was the one being decremented. But these very rare and useful instructions (for creating loops) have not much to do with this discussion about PIO, which are far more complex and programmable!
@TimoBirnschein
@TimoBirnschein 3 роки тому
This looks like the perfect uC to implement some very serious bus sniffers like I2C or SPI. BusPirate has proven to be too slow and unreliable for this, FPGAs as a bit too unapproachable for most.
@SWJIAO
@SWJIAO 3 роки тому
is it possible to implement QSPI(Quad-SPI) with PIO of Pico?
@thegenxgamerguy6562
@thegenxgamerguy6562 2 роки тому
Is PIO fast enough to emulate the bus operation of an 8 MHz CPU? I want to hardware emulate an 8086.
@patrickcs
@patrickcs 3 роки тому
I will make document from this it’s great. Do you have access to more info ?
@WistrelChianti
@WistrelChianti 3 роки тому
9:08 isn't it off for 1 cycle, on for 2? (the 2nd cycling being the jmp command execution) just checking really.
@tmkkka8093
@tmkkka8093 3 роки тому
You are correct, but your timecode is wrong ;)
@peter9477
@peter9477 3 роки тому
More like 8:55 but yeah.
@aleXelaMec
@aleXelaMec Рік тому
Sad you didnt make some examples. But overall a great vid. Thanks
@trhosking
@trhosking Рік тому
He links to examples in the description
@aleXelaMec
@aleXelaMec Рік тому
@@trhosking my bad. Thanks
@bennguyen1313
@bennguyen1313 9 місяців тому
Any examples of some of the cool things that people have imagined with this type of I/O power? For example, I looked for some logic analyzer or AWG, but nothing on YT shows up!
@lawrencedoliveiro9104
@lawrencedoliveiro9104 3 роки тому
16:33 Those are just labels that don’t have any special meaning to the assembler. The CPU program then has to set the values of these labels into the relevant PIO registers to enable wrapping.
@xy-box
@xy-box 3 роки тому
I’m not clear: what is application for this? Maybe any examples? Do you continue?
@proxy1035
@proxy1035 3 роки тому
3:05 wait, since the Arduino core for the Pico allows for overclocking to ~250MHz does that also make the PIO run faster?
@tmkkka8093
@tmkkka8093 3 роки тому
Yes, PIO runs with system clock (so 250MHz overclocked) or you can set it to custom, lower frequency via a divider.
@csbluechip
@csbluechip Рік тому
I have seen reports of the RP2040 being overclocked to 270MHz, but the Pico Dev Board UNDERclocks the CPU to 125MHz ...so remember to calculate your divider based on the clock speed returned by `clock_get_hz(clk_sys)`
@nickaxworthy3236
@nickaxworthy3236 Рік тому
Thanks
@stacksmashing
@stacksmashing Рік тому
Oh, my first Super! Thanks a lot! :)
@taranagnew436
@taranagnew436 2 роки тому
is there a cheatsheet on the io pins commends?
@lukamarin9622
@lukamarin9622 4 місяці тому
If this post wasn't so 'old', I could have swear it is 100% machine (AI) generated! The speed, rhythm, regularity of reading a text is definitely a robot's voice, no doubt in my mind. Anyways, a good presentation, although a bit superficial.
@madierardmovies9634
@madierardmovies9634 Рік тому
Aren't the arrows for RX and TX backwards on the shift register slide? ISR IN has a RX FIFO arrow pointing away from ISR IN. (and Vice versa for out)
@madierardmovies9634
@madierardmovies9634 Рік тому
(at time 2:59)
@madierardmovies9634
@madierardmovies9634 Рік тому
IGNORE my IGNORANCE... all relative to GPIOs. So input from GPIO's to FIFO buffers, to CPU(?).
@FluffyAngelUwU
@FluffyAngelUwU 2 роки тому
Go pio yeah yeah go pio yeah
@gudenau
@gudenau 3 роки тому
I'm going to want to make a specialized one wire serial adapter with this thing one day. Edit: Is there a simulator for this? I don't have the hardware to debug the input and output of one of these, would love to be able to provide some basic pin states over time and be able to plot what it does over time.
@dieSpinnt
@dieSpinnt 3 роки тому
Search for "Signal/Noise Ratio". One Wire ... ROTFL From Wikipedia: "1-Wire is a device communications bus system designed by Dallas Semiconductor Corp. that provides low-speed (16.3 kbit/s[1]) data, signaling, and power over a single conductor." There is a reason why this is low speed. By specification you don't need high-speed shenanigans like shown in the video and simply by the physics. It is impossible to get a good signal integrity via this bus-implementation at high frequencies. If you are flying up to the 100MHz+ range, nobody can deny technologies like LVDS and the study of high frequency behavior of electronics and the corresponding physics. Also, that the pico can theoretically generate these signals must not mean that he can also DRIVE the signals necessary. Don't get me wrong, please try your (by my understanding) worthless experiments. Maybe with a better bus? At least two wires? Well wired for high frequencies with buffers? The simulator: RTFM, I mean the data-sheet (Reference and Programming) and really ... you need a simulator for a $5 device you can debug and watch at the oscilloscope? Please stop joking ... no, have fun!:)
@gudenau
@gudenau 3 роки тому
@@dieSpinnt If you want me to get a DSO by all means send me the money.
@dieSpinnt
@dieSpinnt 3 роки тому
@@gudenau Nope. I am not forcing you into something. You can live without one, but then ... you simply can't do what you are trying to do. Just that:)
@stacksmashing
@stacksmashing 3 роки тому
Jedzia you should really overthink your attitude, you are not contributing positively.
@dieSpinnt
@dieSpinnt 3 роки тому
@@stacksmashing Take for example the very good qemu-arm emulator. It is impossible to translate timings to a real chip. High speed one-wire protocol ... I overthought it: He will try it with or without me. DSO: There are $29 STM32F103 based ones out there which would be fine for 16kbit/s. I don't gave that advice from thin air. To prevent tears and frustration! Low speed applications, but not for 200MHz SPI or something in that region .... which always works and you can as a bonus ... rely on! Skepticism is always not seen as positivity. But thanks that you RTFM and present that here with your videos. Can't wait for a real world app of PIO.
@Mr.Leeroy
@Mr.Leeroy 3 роки тому
how similar or different is RP2040s PIO to something like 81C55 IC? Could same functionality be implemented externally on other MCUs?
@dieSpinnt
@dieSpinnt 3 роки тому
It is totally different from your RAM chip:) I think you meant a micro-controller with a 80ties series core(?). Totally different architectures (ARM)from a totally different time-period. Yes, such high-frequency functionality can be implemented with standard gate logic, FPGA or something similar. At all, first you have a problem and then you solve it ... not the other way around. Lets wait for some hobbyist talking about their +200MHz SPI and then have a good laugh.
@Mr.Leeroy
@Mr.Leeroy 3 роки тому
​@@dieSpinnt I guess, I should rephrase. I am interested if there exist a readily available IC that could bring PIO functionality to other MCUs. I just recall this RAM chip used in some similar way in a schematic of some production device. That's why I saved it, but I am still lucking embedded designing/programming skills to read datasheets fluently to fully understand chips capabilities. I get that Picos PIO is built internally with the same logic that you could design externally with discrete parts, but that is like reinventing the wheel and a whole lot of work on a completely different level of EE, and there are problems like shared memory, that are probably not that trivial to solve, etc.. FPGAs are simply in a order of magnitude different price category, and the thing with reinventing the wheel still stands if there exist integrated solution.
@dieSpinnt
@dieSpinnt 3 роки тому
@@Mr.Leeroy Simple experimenting boards for FPGAs are under $20. Chips, PLDs are a fraction of it. I think, this PIO is a nice gimmick and other MCUs handle problems given just equally good with other technologies like IRQ, normal buffers/plain old shift register, dedicated counters and DMA. ..... The problem comes first, then the solution:) So that PIO first has to show its superiority in a real world use case. An example of my skepticism: A traffic light control could be implemented very elegantly with this PIO facility. But that is far from being a high-speed application. In addition, this can be programmed exactly in the traditional way. Without any addition that might be extremely difficult to debug. The instruction memory is much too small and even more difficult to understand for fast applications. It's just old wine in new bottles. The timing has to be right, with or without a PIO. PIO is not cut off from the rest of the application ... And if it is (like a gimmick) it means that the rest of the processor is bored and I would not have needed PIO in the first place. Have you seen Schmitt-Trigger inputs as such for high-speed I/O? Not me:) And I've never seen a programmable DMA controller with PHB(Peripheral High-Speed Bus) access before. No, that was meant ironic. You have to search hard for a MCU without one, these days:) I am not saying this is not useful. Only that this is not something special and maybe a little hyped.
@Mr.Leeroy
@Mr.Leeroy 3 роки тому
@@dieSpinnt I'm not advocating for PIO like something worth writing home about in terms of real product design. It's seems like relic from the past. Although, the fact that it is not blocking main cores could come in handy one rainy day. Sure you can code the same thing in a bunch of different ways. But it fits well in Raspberrys educational theme and is indeed an intriguing little feature in educational perspective, just something very low level to tinker (play really) with, get out of comfort zone of Wiring framework.
@dieSpinnt
@dieSpinnt 3 роки тому
@@Mr.Leeroy No, sorry. I'm not blaming you. I just think it's terrible that so many others are now on the hype. Blinkers. As if there was nothing else. Programmable I/O is a very flexible and good concept. This is moving in the direction of parallelization or externalization, and there, too, the necessary caution must be exercised. Your thoughts about the Arduino / Wiring Framework? Absolutely true! Let us surprise;)
@FindecanorNotGmail
@FindecanorNotGmail 3 роки тому
You forgot to mention that DMA can be used to read and write the FIFOs. Because you didn't, I started to doubt that it had DMA so I had to look it up in the docs.
@stacksmashing
@stacksmashing 3 роки тому
At 1:55 you can see DMA listed on the left side :)
@SimonTekConley
@SimonTekConley 10 місяців тому
Wow, I didn't realize the Raspberry PI Pico's have been out for 2 years now.
@qbalsdon
@qbalsdon 3 роки тому
How do we go deeper into this?
@BrownianMotionPicture
@BrownianMotionPicture 2 роки тому
I never fail to be impressed by the features of the rp2040, and it's
@rjameslower
@rjameslower 3 роки тому
Stupid question . What Is the diference between stm32 AND this pio?
@MrEdwardhartmann
@MrEdwardhartmann 3 роки тому
pio is a programable co-processor of the RP2040 micro processor made by Raspberry Pi. STM32 is a family of microprocessors (I think the company name is ST Microelectronics) - there are probably more than a hundred different versions of STM32 microprocessors depending on what capability you need. Here is a video comparing the black pill with an STM32f411ceu6 with a Pico - ukposts.info/have/v-deo/gWKHl3-Co4Jemqs.html
@duprie37
@duprie37 3 роки тому
Your English accent is so adorable 🥰
@Thaumatichthys
@Thaumatichthys 2 роки тому
8:19 shouldn't x be decremented even if it is zero?
@johnadriaan8561
@johnadriaan8561 Рік тому
You're right. According to the RP2040 datasheet: "JMP X-- and JMP Y-- always decrement scratch register X or Y, respectively. The decrement is not conditional on the current value of the scratch register."
Raspberry Pi Pico - PIO explained
50:01
Slador
Переглядів 24 тис.
Raspberry Pi Pico Lecture 15: PIO Overview and Examples
1:13:04
Hunter Adams
Переглядів 6 тис.
Артем Пивоваров х Klavdia Petrivna - Барабан
03:16
Artem Pivovarov
Переглядів 3,2 млн
0% Respect Moments 😥
00:27
LE FOOT EN VIDÉO
Переглядів 19 млн
And what’s your age? 🥰 @karina-kola
00:12
Andrey Grechka
Переглядів 6 млн
What is VGA and How to Use it With a Raspberry Pi Pico
18:28
Gary Explains
Переглядів 48 тис.
The Pi Pico has problems, so I made my own, the ProPico
7:17
Dmytro Engineering
Переглядів 34 тис.
Turning a Raspberry Pi Pico into a GPU!
16:42
element14 presents
Переглядів 98 тис.
How the Apple AirTags were hacked
8:38
stacksmashing
Переглядів 1,6 млн
Raspberry Pi Pico talks to Intel 80188 as I/O device
1:00:36
Slador
Переглядів 6 тис.
We should use this amazing mechanism that's inside a grasshopper leg
19:19
Running a Buffer Overflow Attack - Computerphile
17:30
Computerphile
Переглядів 2 млн
Hacking my garage door with the Raspberry Pi Pico W
11:50
Jeff Geerling
Переглядів 332 тис.
Arduino vs Pico - Which is the Best Microcontroller For You?
20:38
Gary Explains
Переглядів 277 тис.
Samsung or iPhone
0:19
rishton_vines😇
Переглядів 98 тис.
Cách sửa này được không các bạn?
1:00
Cơ Khí Toàn Nghĩa
Переглядів 849 тис.
GitHub Copilot just got promoted to Captain
4:01
Fireship
Переглядів 344 тис.
Обзор Nothing ear (3) и ear (a) - ПРОРЫВ за $100
17:34