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

Поділитися
Вставка
  • Опубліковано 26 гру 2024

КОМЕНТАРІ •

  • @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 роки тому +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  2 роки тому

      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? 🤣