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!
@AndrewTubbiolo3 жыл бұрын
My grandpappy told me that PIO stands for Pilot Induced Oscillation.
@hand-somepaws92853 жыл бұрын
He ain't wrong
@packratswhatif.39902 жыл бұрын
I thought it meant : Pigs In Outer-Space .
@SpeccyMan2 жыл бұрын
Parallel Input Output
@SpeccyMan2 жыл бұрын
@@packratswhatif.3990 Not quite, since outer space isn't hyphenated. Try "Pigs In Orbit" instead.
@BrownianMotionPicture3 жыл бұрын
PIO is a great gift to the world. Thank you RPTL.
@paulmichaelfreedman83342 жыл бұрын
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.
@Splarkszter2 ай бұрын
Would be cool if you shared that code. Sounds really awesome!
@rondamon44083 жыл бұрын
Very interesting! I'm really enjoying my pico
@joeblow60883 жыл бұрын
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!
@jyvben15203 жыл бұрын
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)
@JosSSMr3 жыл бұрын
Hi, PIO is present in other Raspberry devices or only in Pico? Thanks in advance
@2231puppy3 жыл бұрын
PIO is only for the RP2040 chips. The other RPis use Broadcomm chips, so they do not have PIO
@allthegearnoidea67522 жыл бұрын
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
@markharrisllb2 жыл бұрын
Don't ESP32s have PIO? Or is my naivety showing?
@mafhper3 жыл бұрын
My pico is on the way :)
@duncanx993 жыл бұрын
The link to more information just results in a 'This Page Can't Be Reached' error...
@raspberrypi3 жыл бұрын
Eeek. How about now?
@duncanx993 жыл бұрын
@@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...
@jyvben15203 жыл бұрын
a day later, no problemo, results in "www.raspberrypi.org/documentation/rp2040/getting-started/"
@siriokds2 жыл бұрын
It can be useful to make a 5V tolerant gpio Pi Pico.
@AgainPsychoX3 жыл бұрын
I wonder, can I make USB port out of those PIO???
@gamertron08823 жыл бұрын
Well... yes but why, why would you do that, there is already a micro usb on the pico
@AgainPsychoX3 жыл бұрын
@@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.Leeroy3 жыл бұрын
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.
@julianbinder23713 жыл бұрын
its probably easier to use something like autohotkey or just some python libraries to do that on your computer itself, which is free
@rohitjg3 жыл бұрын
When is support for arduino ide coming?
@TimothyChapman3 жыл бұрын
What about using this as a USB joystick?
@julianbinder23713 жыл бұрын
you could just use the on-board usb-connection for that, reading out a USB-joystick should be pretty easy even without PIO
@Henry-sv3wv2 жыл бұрын
@@julianbinder2371 someone made usb interface with the PIO for the LULZ
@modm88433 жыл бұрын
Great video
@paulmichaelfreedman83342 жыл бұрын
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)
@gulotts3 жыл бұрын
The morse code was SOS?!! Oh no
@neils1323 жыл бұрын
it was “RASPBERRY PI” sent backwards i p y r r e b p s a r
@RogerTannous3 жыл бұрын
Why do you always try to advertize for MicroPython in your videos while C++ is also possible with RP2040
@randomuser24683 жыл бұрын
Woohoo!
@신디-z2v3 жыл бұрын
thanks~
@BharatMohanty3 жыл бұрын
Bought my first ever single board computer (pi zero w)
@bg313373 жыл бұрын
But keep in mind that an RPi Pico is not a SBC anymore. It's a microcontroller
@SpeccyMan2 жыл бұрын
Morse Code is NOT a series of dots and dashes. It is a series of dits and dahs!
@will9twl3 жыл бұрын
can anyone identify another MCU that has a PIO too?
@Henry-sv3wv2 жыл бұрын
RP2040 is the only one.
@hellterminator3 жыл бұрын
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.
@jamesbrown999912 жыл бұрын
Are you sure it's not pronounced "eye eye see"?
@Henry-sv3wv2 жыл бұрын
on avr it's called: TWI - two wire interface
@AlexejSvirid Жыл бұрын
Actually, I²C is Inter-IntegratedCircuit, or Inter-IC protocol. That's why I is squared.
@TyronStDenis3 жыл бұрын
It’s the only Internet that you always will be Connected to Wi-Fi and Data with this PIO Thing.
@cokeforever2 жыл бұрын
No sound at all??
@jaskaranbindra99393 жыл бұрын
Is this Mark Zuckerberg's voice?
@jamesbrown999912 жыл бұрын
No. The dude sounds irish
@victorschlim46443 жыл бұрын
If my understanding is correct, this is the same as DMAs in other microcontrollers.
@wuschelmohr3 жыл бұрын
No
@chinoto13 жыл бұрын
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.
@massimookissed10232 жыл бұрын
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.