Raspberry Pi Pico PIO - PIO Interrupts using C - Ep. 19

Поділитися
Вставка

КОМЕНТАРІ • 43

  • @MordecaiV
    @MordecaiV Рік тому +16

    I know you'll probably have more popular videos with micropython, but I really really appreciate the c level videos.

    • @LifewithDavid1
      @LifewithDavid1  Рік тому +4

      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!

  • @davidmiddleton2927
    @davidmiddleton2927 Рік тому +4

    I am very impressed and grateful for your efforts

  • @goowatch
    @goowatch Рік тому +2

    Thank you! I learned a lot. Your explanations are the best

  • @danman32
    @danman32 8 місяців тому

    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.

    • @LifewithDavid1
      @LifewithDavid1  8 місяців тому

      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!

  • @Steven-jf4cs
    @Steven-jf4cs 7 місяців тому

    I've seen many interrupt introductions and this was by far the best! Top drawer!

  • @honorbean2973
    @honorbean2973 7 місяців тому

    Wow this is impressive. Nice work!

  • @sapiosuicide1552
    @sapiosuicide1552 5 місяців тому

    This video saved my life

    • @LifewithDavid1
      @LifewithDavid1  5 місяців тому

      Wow, that's a lot of pressure! Thanks for watching (and living). :-)

  • @kamals4905
    @kamals4905 Рік тому +1

    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👍

    • @LifewithDavid1
      @LifewithDavid1  Рік тому

      Glad you liked it. I'll have to look at neopixel. I see there are exercises in the SDKs. Thanks for watching!

  • @28add11
    @28add11 Рік тому

    Thanks! Very helpful to learn about all the C interrupts.

  • @markday3145
    @markday3145 Рік тому

    "All modern processors use interrupts." It warmed my heart to see a 6502 among the modern processors. Interrupts were simpler back then...

    • @LifewithDavid1
      @LifewithDavid1  Рік тому +1

      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!

  • @jimm7001
    @jimm7001 Рік тому +1

    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.

    • @LifewithDavid1
      @LifewithDavid1  Рік тому +1

      Thank you. We handle it with museum curator gloves and wash it periodically. LOL.

  • @davidkender4660
    @davidkender4660 9 місяців тому

    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

    • @LifewithDavid1
      @LifewithDavid1  9 місяців тому

      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!

  • @martinbonfiore7871
    @martinbonfiore7871 2 місяці тому

    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.

    • @LifewithDavid1
      @LifewithDavid1  2 місяці тому

      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!

    • @martinbonfiore7871
      @martinbonfiore7871 2 місяці тому

      @@LifewithDavid1 Thanks!

  • @fabiovsroque
    @fabiovsroque Рік тому

    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...

    • @LifewithDavid1
      @LifewithDavid1  Рік тому +1

      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!

    • @fabiovsroque
      @fabiovsroque Рік тому +1

      @@LifewithDavid1 Thank you very much for the hints!

  • @deanbell5164
    @deanbell5164 Рік тому

    Have you thought about linear power control of AC with triac(s) bye using the PIO?

    • @LifewithDavid1
      @LifewithDavid1  Рік тому

      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.

    • @deanbell5164
      @deanbell5164 Рік тому

      @@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.

    • @LifewithDavid1
      @LifewithDavid1  Рік тому +1

      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.

    • @deanbell5164
      @deanbell5164 Рік тому

      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.

  • @wktodd
    @wktodd Рік тому +1

    Interesting Dave. But ... A Muppet?

  • @robminderman7213
    @robminderman7213 Рік тому +2

    Thumbs up for puppets

    • @LifewithDavid1
      @LifewithDavid1  Рік тому

      Always wondered what Captain Pico would sound like!

  • @jyvben1520
    @jyvben1520 Рік тому

    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)

    • @LifewithDavid1
      @LifewithDavid1  Рік тому

      Maybe MicroPython will be a little less overwhelming. Thanks for watching!