I like C so much better. Yeah, it's a little more complicated; but you have much better control with C. You'll see how much better C is with interrupts than MicroPython. Thanks for watching!
I encountered kernel panics too when i used interrupt callback in ESP32 to indicate when an ADC sample was ready to calculate RMS voltage to current routine. Solution there was to use RTOS built into the ESP32 framework. In the case of the Pico, the so-called crash may be the watchdog timer, which was the issue with the ESP32. Interrupt callbacks on ESP32 would hold up all other background housekeeping, including clearing the watchdog timer in a timely manner.
Best tutorial I've ever watched about pio As i understand with this example, here is second scenario, Drive addressable led (neopixel or ws2812)with any other mcu, Decode that signal with pio instance ,by doing that I think it will be easy to understand more clearly Thanks👍
Yea, I purposely threw that in. As you can see from some of my previous videos, I really like the 6502. It was cutting edge when I started designing my computer. In fact I have a 3rd quarter 1975 version in a ceramic and gold DIP. You are right; interrupts were much simpler. Thanks for watching!
David, you "compiled" a lot of information into this video! Nice presentation. But, a tangential question: We appear to be at around 100 videos. Do you know what the rating is for the service life of the Vid-Shirt? Thanks.
David, Can all your assiduous effort be translated into an equivalent Pico library routine (using the Arduino IDE) of mimicking the Arduino's Interruption Service Routine along with attachInterrupt? It would stupendous if the Pico hardware interrupt worked on multiple GPIO pins with Modes RISING, FALLING, CHANGE; but I would be ecstatic with only one Pico GPIO pin and any of the modes. Thank you for all of your diligent work and brilliant video tutorials. Dave K
Thank you for the comment and suggestion. I will have to look into that. Unfortunately, I'm not very familiar with the Arduino Interrupt Service routine; so it will take a bit of study before I can figure out what to do. In my last video, I did use interrupts; but not for GPIO. Thanks for watching!
Great series! I am trying to understand a program that I found that uses IO_IRQ_BANK0 and I am not understanding. It seems to different and maybe powerful but why someone would use it is not clear. Any help or pointers to info would be greatly appreciated.
Bank 0 is the GPIO. IO_IRQ_BANK0 refers to NVIC interrupt #13 (table 80 of the RP2040 datasheet). Check out section 2.19.5.2. "Enable a GPIO interrupt" of the RP2040 datasheet to help understand how to use GPIO Interrupts. You would use GPIO interrupts so you don't always have to check the status of the GPIO. Instead, let the interrupt start an interrupt service routine when the GPIO changes state. Then the core can do something productive, like comprehending its navel, while waiting for a GPIO to fire. It does take a bit of head scratching to understand how to set up these interrupts. Good luck!
If you mean IO_IRQ_BANK0 of the NVIC, then you are right However, since it is part of the NVIC; it is very powerful. I haven't experimented with it much, but I believe you can set it up such that any and/or all GPIO pads can throw an IObank interrupt; it's up to the callback routine to figure out which one. That makes sense because you wouldn't want multiple NVIC interrupts hitting at once for "simultaneous" signals; there would be more racing going on than at the Indy 500. Like I said, I haven't experimented with this; maybe look into the NVIC part of the ARM Cortex M0+ architecture for more information. Thanks for watching!
That would take a little thought. An easy way to determine 0 crossing time would be to use the RP2040's built in ADC. PIO doesn't access the ADC directly, however, you might be able to do something with DMA; I'm not sure. The other way would be to build a 0 crossing detector circuit and feed that into the PIO. Interesting.
@@LifewithDavid1 I use a H11AA1 for the zero crossing detection and DMA for the PIO plumbing with interrupts for the triggers. I thought this may a good topic for one of your PIO videos.
By the way I have a 1000 steps for the power to (half) phase table, this is for accurate solar power diversion into a 4Kw load. 230V @ 50Hz here in NZL.
wow, too much for me, intro ok which suggests we could chain pio statemachines using the register, so when limited by one pio "program" we end with setting a register which then lets the next statemachine do ... (could be wrong but i'll never find out)
I know you'll probably have more popular videos with micropython, but I really really appreciate the c level videos.
I like C so much better. Yeah, it's a little more complicated; but you have much better control with C. You'll see how much better C is with interrupts than MicroPython. Thanks for watching!
I am very impressed and grateful for your efforts
Thank you so much 😀
Thank you! I learned a lot. Your explanations are the best
Glad it was helpful! Thanks for watching!
I encountered kernel panics too when i used interrupt callback in ESP32 to indicate when an ADC sample was ready to calculate RMS voltage to current routine.
Solution there was to use RTOS built into the ESP32 framework.
In the case of the Pico, the so-called crash may be the watchdog timer, which was the issue with the ESP32. Interrupt callbacks on ESP32 would hold up all other background housekeeping, including clearing the watchdog timer in a timely manner.
I expect you are correct. I've done interrupts using bare metal with no watchdog tmer and they are rock solid. Thanks for the comment!
I've seen many interrupt introductions and this was by far the best! Top drawer!
Thank you!
Wow this is impressive. Nice work!
Thank you very much!
This video saved my life
Wow, that's a lot of pressure! Thanks for watching (and living). :-)
Best tutorial I've ever watched about pio
As i understand with this example, here is second scenario,
Drive addressable led (neopixel or ws2812)with any other mcu,
Decode that signal with pio instance ,by doing that
I think it will be easy to understand more clearly
Thanks👍
Glad you liked it. I'll have to look at neopixel. I see there are exercises in the SDKs. Thanks for watching!
Thanks! Very helpful to learn about all the C interrupts.
Glad it was helpful!
"All modern processors use interrupts." It warmed my heart to see a 6502 among the modern processors. Interrupts were simpler back then...
Yea, I purposely threw that in. As you can see from some of my previous videos, I really like the 6502. It was cutting edge when I started designing my computer. In fact I have a 3rd quarter 1975 version in a ceramic and gold DIP. You are right; interrupts were much simpler. Thanks for watching!
David, you "compiled" a lot of information into this video! Nice presentation. But, a tangential question: We appear to be at around 100 videos. Do you know what the rating is for the service life of the Vid-Shirt?
Thanks.
Thank you. We handle it with museum curator gloves and wash it periodically. LOL.
David,
Can all your assiduous effort be translated into an equivalent Pico library routine (using the Arduino IDE) of mimicking the Arduino's Interruption Service Routine along with attachInterrupt?
It would stupendous if the Pico hardware interrupt worked on multiple GPIO pins with Modes RISING, FALLING, CHANGE; but I would be ecstatic with only one Pico GPIO pin and any of the modes.
Thank you for all of your diligent work and brilliant video tutorials.
Dave K
Thank you for the comment and suggestion. I will have to look into that. Unfortunately, I'm not very familiar with the Arduino Interrupt Service routine; so it will take a bit of study before I can figure out what to do. In my last video, I did use interrupts; but not for GPIO. Thanks for watching!
Great series! I am trying to understand a program that I found that uses IO_IRQ_BANK0 and I am not understanding. It seems to different and maybe powerful but why someone would use it is not clear. Any help or pointers to info would be greatly appreciated.
Bank 0 is the GPIO. IO_IRQ_BANK0 refers to NVIC interrupt #13 (table 80 of the RP2040 datasheet). Check out section 2.19.5.2. "Enable a GPIO interrupt" of the RP2040 datasheet to help understand how to use GPIO Interrupts. You would use GPIO interrupts so you don't always have to check the status of the GPIO. Instead, let the interrupt start an interrupt service routine when the GPIO changes state. Then the core can do something productive, like comprehending its navel, while waiting for a GPIO to fire. It does take a bit of head scratching to understand how to set up these interrupts. Good luck!
@@LifewithDavid1 Thanks!
Hi David, is it true that Pi Pico has only one pin interrupt, or GPIO interrupt per core? I can't beleave, I am devastated...
If you mean IO_IRQ_BANK0 of the NVIC, then you are right However, since it is part of the NVIC; it is very powerful. I haven't experimented with it much, but I believe you can set it up such that any and/or all GPIO pads can throw an IObank interrupt; it's up to the callback routine to figure out which one. That makes sense because you wouldn't want multiple NVIC interrupts hitting at once for "simultaneous" signals; there would be more racing going on than at the Indy 500. Like I said, I haven't experimented with this; maybe look into the NVIC part of the ARM Cortex M0+ architecture for more information. Thanks for watching!
@@LifewithDavid1 Thank you very much for the hints!
Have you thought about linear power control of AC with triac(s) bye using the PIO?
That would take a little thought. An easy way to determine 0 crossing time would be to use the RP2040's built in ADC. PIO doesn't access the ADC directly, however, you might be able to do something with DMA; I'm not sure. The other way would be to build a 0 crossing detector circuit and feed that into the PIO. Interesting.
@@LifewithDavid1 I use a H11AA1 for the zero crossing detection and DMA for the PIO plumbing with interrupts for the triggers. I thought this may a good topic for one of your PIO videos.
That would be cool. Thanks for the suggestion. There is so many things that little board can do; I hope to do so many projects.
By the way I have a 1000 steps for the power to (half) phase table, this is for accurate solar power diversion into a 4Kw load. 230V @ 50Hz here in NZL.
Interesting Dave. But ... A Muppet?
Captain Pico strikes!
Thumbs up for puppets
Always wondered what Captain Pico would sound like!
wow, too much for me, intro ok which suggests we could chain pio statemachines using the register, so when limited by one pio "program" we end with setting a register which then lets the next statemachine do ... (could be wrong but i'll never find out)
Maybe MicroPython will be a little less overwhelming. Thanks for watching!