Watchdog Timer - What is it, and how to use it in MicroPython

Поделиться
HTML-код
  • Опубликовано: 17 окт 2024
  • What is a Watchdog Timer and how you can use it in MicroPython, on a Raspberry Pi Pico or ESP32.
    Watchdog timers are especially important on embedded systems that need to run, unsupervised for long periods of time to ensure they recover from any issues.
    Join this channel to get access to perks:
    / @kevinmcaleer28
    💁‍♂️ For more information on SMARS Robots, tutorials and more visit: www.smarsfan.com​
    🎖To join the membership at 🥉bronze, 🥈silver or 🥇gold levels, head over to
    www.smarsfan.c...
    Join the list - action.smarsfa...
    ☕️ Enjoy this video? Buy me a coffee! www.buymeacoff...
    📸 Follow me on Instagram - @kevinmcaleer / kevinmcaleer
    🐦 Follow me on Twitter - @kevsmac / kevsmac
    🙂📘 Join the Facebook group - Small Robots / smallrobots
    👩‍💻 My Code on GitHub: www.github.com...
    🎵 Music by Epidemic Sounds www.epidemicso...
    #Pico​ #MicroPython​ #Robotics

Комментарии • 11

  • @samneggs1
    @samneggs1 2 года назад +5

    Nice explanation, very clear.
    If you want more than 8-10 seconds you can roll your own watchdog by counting down a global variable in a core-1 routine and resetting it in your main core-0 routine.
    If the count gets to zero in core-1, do a reset. It’s not as bulletproof as the hardware WDT but it works.
    Also this version can be turned off on normal program exit. The hardware WDT can’t be stopped once stated. (By design I guess)

  • @MikhailHaurylau
    @MikhailHaurylau Год назад

    Fantastic video, Kevin. Saved from mucking around with uasyncio, which seems to be a painful alternative. Extra credit for throwing in the video of your dog ;)

  • @pierre-yves_baloche
    @pierre-yves_baloche 2 года назад +1

    Thanks Kevin for this great tip of the day 👍

  • @NicklasUlvnas
    @NicklasUlvnas 2 года назад +3

    The maximum timeout is 8.4 secs ( or to be exact, 0x7fffff millisec, 8.388607 sec)

  • @daveedwards1663
    @daveedwards1663 Год назад +2

    Hi, great video. What is the impact of starting a watchdog timer and then putting the pico into deepsleep until. a button is pressed? Would the watchdog timer kick in and reset even if in deepsleep or would it pause while in deep sleep?

    • @kevinmcaleer28
      @kevinmcaleer28  Год назад

      Great question Dave - the pico wouldn't know a button is being pressed whilst in deep sleep; you'd need extra external circuitry for that - take a look at how Pimoroni achieves this with the Enviro range.

    • @ashleycawley5816
      @ashleycawley5816 Год назад +1

      Good question, I came here wondering the same, not regards a button, but just how the WDT and deepsleep react to one another, does the deepsleep stop the WDT or not? My project does a little work-load, then sleeps for 2mins and repeats. Works reliably for 5-6 days and then fails. I'll keep looking.

    • @kevinmcaleer28
      @kevinmcaleer28  Год назад

      @@ashleycawley5816 have you looked at logging the state to a log file (using something like Phew!) to make troubleshooting easier.

  • @Maker_of_Things
    @Maker_of_Things 2 года назад

    Am I the only person who watched this hoping it was going to be something to do with the actual dog? 🤣