The grandpa I never knew I needed. Great video sir, I was trying to program PIO this helped me to understand what I was actually doing wrong. Thank you I will be waiting for next part.
Who says old dogs can’t learn new tricks (and teach them exceptionally well too)! You’re a genius! Thanks for the help understanding, your teaching is concise but understandable.
Finally someone showing how to control multiple pins. All of the examples I could find are single pin. I was able to use this to make a pio LCD driver. Next I want to make a 8080 parallel driver for a TFT display I have on hand.
@@LifewithDavid1 one thing that doesn't make sense to me is the auto-pull feature. Shouldn't the threshold be 8 in your program? With it set to 16 you are only ever doing manual pulls. Out is pulling 8 bits then we wrap around and pull a new word into the OSR. Unless I'm not understanding it correctly.
I too had difficulty saying Instantiation to students during lectures in the UK... In the end I used "In-Stan-See-Ay-Shon" Great walk-through of PIO State Machines - Thank you.
Thanks for making this video, David! I just got a few Picos and I’m excited to continue your series and get to making some interesting projects! Edit: Forgot to add that I’ve seen dozens of PIO videos in the past few months and yours by far is the best! Clearest explanation and demonstration I’ve seen!
I've coded (copied) and called a PIO blinking LED example from within a C++ program. I don't know C++ very well and find it tricky, but using PIO took me to whole new level of tricky. Good video, well explained and you've got my sub.
Thank you for your investigation about instantation. I believe that is very important to program microcontrolers with optimum and fast data transfer through GPIOs. This method accelerates the job by using independent machine states further than registers (like arduino). Thank you again.
For some reason this is the only place I've been able to find parallel out to pins example. Thanks, David. Very helpful. Question: Why do you need the autopull=True, pull_thresh=16 in the @asm_pio? Because you already have pull in the program.
...and I thought the documentation for pico is awesome, but this video brings it to the next lvl. Thanks David I should finally build some project around the pico, looks like it should be the goto option for timing sensitive applications. I am rather surprised that I did not find a single example where PIO would be used as a counter tho, I guess noone needs rotary encoders these days.
Working with Pico W means changes. One pin important for testing is onboard Led. Normally was Pin 25, but now for Pico W is connected to infineon chip at WL_GPIO0. In micropython can be addressed like Pin("LED") or Pin("GPIO0"), but... if you try to use that nomenclature in StateMachine() instatation... set_base=Pin("LED") o set_base=Pin("GPIO0")... boom! no way. And.. of course, no documentation from raspberry SDK's, even in Pico W specific datasheet. I believe that for a board good for experimentation, the change of onboard Led is going to cause some headakes. Thanks for your excellent videos!
@@LifewithDavid1 I managed to get two of them (Pico W), send me PM with your address and I'll send you one. I think it will be more productive for the community in your hands!
Great job. You make me this stuff understandable. Could you please make some example about pinsdir ? I'm interested in parallel bidirectional transmission where the direction of the data changes in real time.
I'm also interested in bidirectional parallel data transfer; so pinsdir absolutely will need to be addressed. It might be a while since I wasn't to show some other things first; like the speed increase on actual data with PIO and the delay features. Also, it's getting nicer outside so I have a VW to fix, and camping to do. But I will get to it! Thanks for the suggestion!
@@LifewithDavid1 One issue I'm addressing is how to synchronize pio pindirs with level shifter/buffer IC. Another issue is how to change pindirs to 8bit data pins leaving 16bit address pins as input. Please deal with the topic. 🙏
Hello David, thanks for the great explanation! Could you please also post the respective code sample. That would be great. The Github link does not work.
It would be nice if reorganize your playlists in chronological order and by topic. The one containing this video is partially sorted with a few non-PIO specific videos thrown in, making it difficult to follow along. I had to create my own playlist so I can reorder them. A big benefit of having organized playlists is that you'll rank higher on search results and subsequents video parts will show up on the viewer's queue, which increases your view count.
Thanks, I didn't know I could do that. When I started the play list I just had a couple Pico videos; and then, like rabbits, they multiplied! I'll have to look into that. Thanks for watching!
Hi David, I hold this in my memory, not dive into the PIO yet. There was mentioned somewhere that one of the PIO examples was BUS communication .... let me lookup ... hm... RP2040 datasheet, page 330 mentioned "8080 and 6800 parallel bus" however I did not found it in examples. The PIO is very hard to wrap mind around, and the documentation is hard to understand for me. The learning curve is very flat. Looks the key point is the "3.5.6. GPIO Mapping" on page 359
You're right. But I was just demonstrating output. The 8 bits will just roll over. For instance, it could have been from 0 to 20,000,000 and the least significant 8 bits would just keep rolling over. However you are right, I can only output 255 using the LED display I mapped. Thanks for watching!
Good morning David from CT, USA. Great video series on Pi Pico. Would you be interested in doing a Pico-based hardware/software project in C on commercial basis? Kindly let me know. Best wishes. Ashok
Thank you! I'm honored; but I'm not that good. My videos detail my adventures in learning about the Pico. I can't hold a candle to most of the designers out there.
Wait wait... so the FIFO registers are buffered in a way where the data can't be corrupted by my code not accounting for timing/synchronization? The PIO program will just either use the old number or the new number depending on timing?
Yes, they are pretty flexible. For instance see this video (ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-ZEBkM5FQ86Q.html) at about 8:37 to see how PIO can use the latest data from the transmit FIFO; even if no data is available. This video also discusses interrupts across state machines and the main cores.
@@Marc_Wolfe Sounds like a cool project. I'd start by prototyping one system; like maybe real time engine crank position based on a single TDC sensor. That exercise will get your hands dirty with the pico and you can start to see the possibilities. You wouldn't even need an engine, you could use a drill and a hall sensor or IR sensor to start playing with it.
@@LifewithDavid1 If/when you do an Arduino Zero (SAMD21) series, I'd recommend ctrl+F "Event System" when looking through the datasheet. Maybe it can't do quite as complex of stuff, but when it can do the same, it sounds like it'd be much easier to implement.
Hello, thank you for this video. I am very new to electronics, but for my project I need to get my hands on it, is it possible to have a tutorial for the raspberry Pico to play videos randomly after activating an ultra sound sensor if it Please ?
Thanks for watching! The Pico might not be the best device for this. With only 2 MByte of storage and no native video interface, it would be a real struggle. However, a Raspberry Pi Zero would be able to handle it much more easily. I have done a video using a motion detector using a Zero: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-ZPYcAuYemG4.html Hopefully that will help. Good luck!
Great video! What I didnt understand is the part where microcontroller is communicating with this pio with .put() command. Where this i value is sent to?
The processor uses "put" to move data from the processor into the PIO TX (transmit) FIFO. PIO uses "pull" to move data from the TX FIFO into the OSR. PIO uses "push" to move data from the ISR into the RX (receive) FIFO. The processor uses "get" to grab data from the RX FIFO. Hope that helps!