Raspberry Pi Pico W LESSON 88: Understanding PIO State Machine Push, Pull, Put and Get

preview_player
Показать описание
You guys can help me out over at Patreon, and that will help me keep my gear updated, and help me keep this quality content coming:

In this class we will be using the Sunfounder Raspberry Pi Pico W Keppler Kit. It will make things a lot easier if we are working on identical hardware. the link below is to amazon, and is for the identical hardware I will be using in this entire class.

In this video, I will show you how to use the push() pull() get() and put() commands on the Raspberry Pi Pico W using micropython and the PIO state machines. I will show you step by step how to easily exchange data between the PIO state machine and the main python core processor.

More great content at:

#raspberrypipicow
#statemachine
#micropython
Рекомендации по теме
Комментарии
Автор

Thanks for the GREAT lesson Paul!! Looking forward to where else you'll be going with this (PIO). The Pico is truly an amazing board! Sure brings back memories of my start in electronics (with the "bit-banging"). Amazing how far we have come from those days!

leeg.
Автор

You push me so that I get be in the state of mind to learn and put the knowledge to use. I often refer back to earlier episodes and pull bits of code from them to run on my machine. Thanks!

nigelworwood
Автор

Good lesson. Good HW assignment. It helped with understanding all of the possibilities of moving through the rotation of TX-OSR-X-Y-IRS-Y, or take the shortcut from OSR- ISR. I did add some error handling to only allow 0 through 15 to be entered. I am kicking out other numbers and any letters/special characters to be trapped, zero out the lights and then allow the user to retry. Thank you for this series.

craigflorin
Автор

I love moving data between the high level abstracted user interface and the assembly machines. Looking forward to applications of off loading tasks by this strategy. For homework I used a potentiometer for creating the data and used both the GPIO pins and a LED back in the Python program. It produced a nice binary counter and also controlled the pwm led object. The binary counter seemed to increment about every 4700-5000 intervals from the potentiometer. I can’t claim to understand how. Also, when I added two more leds ( I also changed the decorator etc to reflect this) the binary counter still worked but the two additional leds alternated toggling until the pot reached 65535. At that point both were steady on. I’m guessing that the fifo transmitter only holding 4 ‘words’ is the issue. I think there may be an auto run command/ strategy to draw from the fifo to the OSR on the fly. Future study/ lessons ( and help) are needed.

jbelmont
Автор

I am Legend 💪 - I added a little error checking in the while loop to keep the values between 0 and 15 . Thank you Paul.

while True:

value = int(input('What LED value do you want? '))
if value< 0 or value >15:
print('Value must be between 0 and 15, please try again ! ')
print(' ')
else:
sm0.put(value)
a=sm0.get()
print(a)
time.sleep(0.5)
time.sleep(2)
sm0.active(0)

justmc
Автор

I saw the error but it didnt click! Good lesson!

shawnlowe
Автор

Thanks Paul! I had good results in getting the correct data to the pins but got the char data on my python screen., Only one le broken on my Walmart chair
: (

edSabio
Автор

Thanks again for another very clear session Paul. I have a question though. I see why we returned 57 and not nine, but what is the largest number we can use? I would have thought it was 32 because of the limited size of the x and y register. What have I missed?

garyowen
Автор

The strange results 49 and 48 I think is the '1' and the '0' from the input "10"

gofosw