What is PIO | Programmable I/O on Raspberry Pi Pico

  Переглядів 75,562

Raspberry Pi

Raspberry Pi

3 роки тому

Microcontroller chips, like our own RP2040 on Raspberry Pi Pico, offer hardware support for protocols such as SPI and I2C. This allows them to send and receive data to and from supported peripherals.
But what happens when you want to use unsupported tech or multiple SPI devices? That’s where Programmable I/O, or PIO, comes in. PIO was developed just for RP2040 and is unique to the chip.
Learn more: rptl.io/rp2040-get-started
Subscribe to our channel: rptl.io/youtube
Looking for kid-friendly projects, educator-led seminars, and information about our non-profit work? Check out the Raspberry Pi Foundation UKposts channel: rptl.io/rpfyt
BUY A RASPBERRY PI
--------------
Raspberry Pi Pico: rptl.io/pico
Raspberry Pi 4: rptl.io/raspberrypi4
Raspberry Pi 400: rptl.io/400
All Raspberry Pi products: rptl.io/products
Raspberry Pi Store, Cambridge: rptl.io/cambridge
READ OUR BOOKS & MAGAZINES
--------------
The MagPi magazine: rptl.io/themagpi
HackSpace magazine: rptl.io/hackspace
Wireframe magazine: rptl.io/wireframe
Custom PC: rptl.io/custompc
Raspberry Pi Press online store: rptl.io/raspberrypipress
GET HELP WITH YOUR RASPBERRY PI
--------------
Getting started with your Raspberry Pi: rptl.io/gettingstarted
Raspberry Pi Help Guides: rptl.io/help
Raspberry Pi Forums: rptl.io/forums
Technical documentation: rptl.io/techdocs
FOLLOW US
--------------
Twitter: rptl.io/twitter
Instagram: rptl.io/instagram
Facebook: rptl.io/facebook
Raspberry Pi blog: rptl.io/blog
SUPPORT RASPBERRY PI FOUNDATION
--------------
Free coding projects: rptl.io/rpfprojects
Digital Making at Home: rptl.io/dmah
Free online courses: rptl.io/rpfcourses
Raspberry Pi Foundation: rptl.io/rpf
Donate: rptl.io/donate
#RaspberryPi

КОМЕНТАРІ: 58
@AndrewTubbiolo
@AndrewTubbiolo 2 роки тому
My grandpappy told me that PIO stands for Pilot Induced Oscillation.
@hand-somepaws9285
@hand-somepaws9285 2 роки тому
He ain't wrong
@packratswhatif.3990
@packratswhatif.3990 Рік тому
I thought it meant : Pigs In Outer-Space .
@SpeccyMan
@SpeccyMan Рік тому
Parallel Input Output
@SpeccyMan
@SpeccyMan Рік тому
@@packratswhatif.3990 Not quite, since outer space isn't hyphenated. Try "Pigs In Orbit" instead.
@McTroyd
@McTroyd 2 роки тому
You guys really nailed it with the PIO on the RP2040. This is cool on so many levels, from introducing the basics of Assembler to a Python user, to solving the timing problems you mention in this video. Looking forward to seeing what comes next!
@BrownianMotionPicture
@BrownianMotionPicture 2 роки тому
PIO is a great gift to the world. Thank you RPTL.
@rondamon4408
@rondamon4408 3 роки тому
Very interesting! I'm really enjoying my pico
@joeblow6088
@joeblow6088 3 роки тому
Cool video, and great explanation! I've had issues with checking for button input while executing other code. It's probably mostly due to the fact that I'm not very good at coding, but it will be helpful to learn to use State Machines for things like that. NeoPixels are also a great example, because it's something I add to most of my projects. Looking forward to your future videos!
@jyvben1520
@jyvben1520 3 роки тому
do you use an irq handler, that works fine for button, use pull=Pin.PULL_DOWN (the button delivers 3.3v when pressed) use pull=Pin.PULL_UP ( the button connects to ground when pressed ) import machijne # or from machine import Pin, disable_irq, enable_irq buttonX=machine.Pin(2, machine.Pin.In, pull=machine.Pin.PULL_DOWN) buttonX.irq(trigger=machine.Pin.IRQ_RISING, handler=pin_irq) buttonXwaspressed = False # variable you can check in your main loop, reset it when your code has acted on it. def pin_irq(pin): state = machine.disable_irq() # no interrupt while handling this one # change a variable or act on another pin, if using a variable then global buttonXwaspressed # essential to use the global already existing variable buttonXwaspressed = True # let your main loop react to this machine.Pin(25).value(1) # example, act on hardware, onboard led is turned on. #end handler with machine.enable_irq(state) # all irq handlers will act as expected # you can have the irq handler react to which pinname is given in the parameter, butn1.irq(trigger=machine.Pin.IRQ_RISING, handler=pin_irq) butn2.irq(trigger=machine.Pin.IRQ_RISING, handler=pin_irq) in "def pin_irq(pin)" function if pin == butn1: # change or set ... e.g. ON/1/True elif pin == butn2: # change or set ... e.g. OFF/0/False or increment (e.g. += 1024)
@NextLevelCode
@NextLevelCode 3 роки тому
I hope you guys make a version with WiFi /Bluetooth. Would be amazing. Like an ESP32 + Pico baby.
@almostprofessionalrecords6651
@almostprofessionalrecords6651 3 місяці тому
there is Raspberry Pi Pico W
@kavorka8855
@kavorka8855 3 роки тому
AMAZING!
@modm8843
@modm8843 3 роки тому
Great video
@paulmichaelfreedman8334
@paulmichaelfreedman8334 Рік тому
I made a matrix of 37 x 8 pixels from a single 300 RGB LED strip and used a pi pico to drive it. I mapped the PETSCII font so it can scroll a text that looks like the C64 including all the graphics characters. The micropython program used PIO to push the data to the LEDs with exact timings. I admit I did not write that code myself but it's also pointless trying to re-invent the wheel so I just copied that code. But I can say out of experience that the RP2040 is pretty darn powerful for its price and size. And now you can emulate a C64 with it including a 320x240 display! It uses PIO to exactly time the VGA output signal which is generated on the fly because the Pico does not have enough RAM for a frame buffer.
@mafhper
@mafhper 3 роки тому
My pico is on the way :)
@user-tl7zy4hc7n
@user-tl7zy4hc7n 2 роки тому
thanks~
@siriokds
@siriokds 2 роки тому
It can be useful to make a 5V tolerant gpio Pi Pico.
@randomuser2468
@randomuser2468 3 роки тому
Woohoo!
@JosSSMr
@JosSSMr 3 роки тому
Hi, PIO is present in other Raspberry devices or only in Pico? Thanks in advance
@2231puppy
@2231puppy 3 роки тому
PIO is only for the RP2040 chips. The other RPis use Broadcomm chips, so they do not have PIO
@gulotts
@gulotts 3 роки тому
The morse code was SOS?!! Oh no
@neils132
@neils132 3 роки тому
it was “RASPBERRY PI” sent backwards i p y r r e b p s a r
@markharrisllb
@markharrisllb Рік тому
Don't ESP32s have PIO? Or is my naivety showing?
@allthegearnoidea6752
@allthegearnoidea6752 Рік тому
I have to say I see how PIO is useful but as a beginner I thinks it makes thinks like writing a byte to a port much more complicated than it needs to be. Maybe there is a library that can do this but if so haven’t found it yet. Happy to receive advice if anyone has more knowledge that’s. Best regards Chris
@duncanx99
@duncanx99 3 роки тому
The link to more information just results in a 'This Page Can't Be Reached' error...
@raspberrypi
@raspberrypi 3 роки тому
Eeek. How about now?
@duncanx99
@duncanx99 3 роки тому
@@raspberrypi That now leads to a valid webpage but I can't see anything specifically related to using the PIO - that only seems to be mentioned once, in relation to dithered pixels. Maybe I misunderstood what was said in the video...
@jyvben1520
@jyvben1520 3 роки тому
a day later, no problemo, results in "www.raspberrypi.org/documentation/rp2040/getting-started/"
@AgainPsychoX
@AgainPsychoX 3 роки тому
I wonder, can I make USB port out of those PIO???
@gamertron0882
@gamertron0882 3 роки тому
Well... yes but why, why would you do that, there is already a micro usb on the pico
@AgainPsychoX
@AgainPsychoX 3 роки тому
@@gamertron0882 My use case is to intercept mouse movement and keys, and make it detect patterns and do stuff - programmable macros for mouse. There are some mouses on the market with functionality like this, but I could use just Pico instead of 50$ mouse + license on their scripting software... Other people could use it also for hardware keyloggers, or maybe some fancy USB hubs.
@Mr.Leeroy
@Mr.Leeroy 3 роки тому
Just look into USB signal integrity, USB eye test and abandon the idea.. Even if Pico has enough frequency for USB 1.1 Low speed, which is probably not the case. You could though poll mouse buttons with your additional MCU like Atmega32u4 and send your macros along the second USB cable or via USB hub IC.
@julianbinder2371
@julianbinder2371 2 роки тому
its probably easier to use something like autohotkey or just some python libraries to do that on your computer itself, which is free
@TimothyChapman
@TimothyChapman 3 роки тому
What about using this as a USB joystick?
@julianbinder2371
@julianbinder2371 2 роки тому
you could just use the on-board usb-connection for that, reading out a USB-joystick should be pretty easy even without PIO
@Henry-sv3wv
@Henry-sv3wv 2 роки тому
@@julianbinder2371 someone made usb interface with the PIO for the LULZ
@rohitjg
@rohitjg 3 роки тому
When is support for arduino ide coming?
@cokeforever
@cokeforever Рік тому
No sound at all??
@BharatMohanty
@BharatMohanty 3 роки тому
Bought my first ever single board computer (pi zero w)
@bg31337
@bg31337 3 роки тому
But keep in mind that an RPi Pico is not a SBC anymore. It's a microcontroller
@paulmichaelfreedman8334
@paulmichaelfreedman8334 Рік тому
Programmed I/O is not new. Many generations of Parallel ATA / IDE harddisks used PIO for data handling. The disk's label would state the type of interface and the mode of operation (PIO mode x)
@SpeccyMan
@SpeccyMan Рік тому
Morse Code is NOT a series of dots and dashes. It is a series of dits and dahs!
@will9twl
@will9twl 3 роки тому
can anyone identify another MCU that has a PIO too?
@Henry-sv3wv
@Henry-sv3wv 2 роки тому
RP2040 is the only one.
@RogerTannous
@RogerTannous 2 роки тому
Why do you always try to advertize for MicroPython in your videos while C++ is also possible with RP2040
@hellterminator
@hellterminator 3 роки тому
It's pronounced "I squared C," not "I two C." It's actually supposed to be stylized I²C as well, but since that wasn't easily doable in the 80s, I2C was accepted.
@jamesbrown99991
@jamesbrown99991 2 роки тому
Are you sure it's not pronounced "eye eye see"?
@Henry-sv3wv
@Henry-sv3wv 2 роки тому
on avr it's called: TWI - two wire interface
@AlexejSvirid
@AlexejSvirid 3 місяці тому
Actually, I²C is Inter-IntegratedCircuit, or Inter-IC protocol. That's why I is squared.
@jaskaranbindra9939
@jaskaranbindra9939 2 роки тому
Is this Mark Zuckerberg's voice?
@jamesbrown99991
@jamesbrown99991 2 роки тому
No. The dude sounds irish
@TyronStDenis
@TyronStDenis 3 роки тому
It’s the only Internet that you always will be Connected to Wi-Fi and Data with this PIO Thing.
@victorschlim4644
@victorschlim4644 3 роки тому
If my understanding is correct, this is the same as DMAs in other microcontrollers.
@wuschelmohr
@wuschelmohr 3 роки тому
No
@chinoto1
@chinoto1 2 роки тому
DMA is for streaming a chunk of memory to another controller on the board, such as SPI, PWM, and possibly PIO. You could implement SPI or PWM by using PIO if you wanted. Supposedly you can use PIO to generate signals for VGA. I plan to use PIO for my ws2812 lights so I can construct just the GRB array and have PIO handle generating the signal instead of passing a 16x larger signal array to the SPI controller.
@massimookissed1023
@massimookissed1023 2 роки тому
DMA is a way of moving data between memory and other devices, without it going through and occupying the core processor. Like instructing an intern to move a stack of papers from the filing cabinet to the broom cupboard without having to supervise and micromanage them doing that task.
Raspberry Pi Pico PIO - Ep. 8 - Introduction to DMA
18:21
Life with David
Переглядів 17 тис.
Arduino vs Pico - Which is the Best Microcontroller For You?
20:38
Gary Explains
Переглядів 277 тис.
КАК ГЛОТАЮТ ШПАГУ?😳
00:33
Masomka
Переглядів 2,1 млн
10 Minutes To Escape Or This Room Explodes!
10:00
MrBeast
Переглядів 67 млн
Кровосток - разговор с легендами / вДудь
2:12:57
10 years of Raspberry Pi
6:47
Raspberry Pi
Переглядів 305 тис.
Raspberry Pi Pico PIO - Ep. 2 - Side Set, Wait, and Handshaking
11:32
Life with David
Переглядів 16 тис.
Turning a Raspberry Pi Pico into a GPU!
16:42
element14 presents
Переглядів 98 тис.
When Did Raspberry Pi become the villain?
21:54
Jeff Geerling
Переглядів 1,3 млн
The Raspberry Pi Pico Review - $4 ARM Microcontroller
11:18
Jeff Geerling
Переглядів 332 тис.
Raspberry Pi Pico: 10 Things You Might Not Know
4:50
Ryan Gaudion
Переглядів 93 тис.
Raspberry Pi Pico PIO - Ep. 14 - Arbitrary Waveform Generator
15:26
Life with David
Переглядів 8 тис.
Нужен ли робот пылесос?
0:54
Катя и Лайфхаки
Переглядів 847 тис.
Нужен ли робот пылесос?
0:54
Катя и Лайфхаки
Переглядів 847 тис.
I7 2600K тест в играх и сравнение с AMD Ryzen
17:53