How to Reset Your Arduino from Code

Поделиться
HTML-код
  • Опубликовано: 11 сен 2024

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

  • @ForceTronics
    @ForceTronics  8 лет назад +1

    Note that the advantage of the method shown in the video versus using the Watch Dog Timer is this method with reset the Arduino MCU as well as anything else tied to the reset pin. The Watch Dog Timer will just reset the MCU.

  • @user-nj5er5es7n
    @user-nj5er5es7n 7 лет назад +2

    Nice and clear. Thanks!

  • @captiveimage
    @captiveimage 7 лет назад +4

    I've used a similar technique, but used an opto-isolator in place of the transistor. In effect, it's working in exactly the same way, but with no transistor 'base' in the circuit; start-up noise and/or spurious floating of pins is not an issue. To activate the reset, the digital pin driving the LED side of the opto-isolator needs to be actively driven to HIGH for the switch to work.

    • @ForceTronics
      @ForceTronics  7 лет назад

      Great comment. Can you share a link to a schematic and / or part numbers you used in your setup?

    • @captiveimage
      @captiveimage 7 лет назад +2

      No problem. I've got this configuration built into my last Arduino project out of my head, but I'll knock up a simple circuit diagram.

    • @captiveimage
      @captiveimage 7 лет назад +2

      fritzing.org/projects/arduino-uno-soft-reset#

  • @efox29
    @efox29 8 лет назад +7

    This is not good practice. It might work now, but its not guaranteed to always work. When the AVR is reset, all I/O become inputs, which means the base of the transistor is not driven by anything. When you have a floating base, anything can happen. If the environment is noisy, you may pick up current enough to cause the transistor to turn on ? Ive worked in a lab where someone had a floating base and their circuit would get all screwy, but when they took it to their desk for debugging, it worked fine. Use a WDT instead. More reliable.

    • @ozgemmo3445
      @ozgemmo3445 8 лет назад

      +efox29 What is a "WDT" - please elaborate. Cheers

    • @efox29
      @efox29 8 лет назад

      +Ian Brown watch dog timer. I have yet to see a microcontroller that does not have one. It's a timer that you have to reset every so often, otherwise, it forces a reset .Its to prevent hangs in the applications, because if you hang, you cant reset the timer, and so the application resets.

    • @ForceTronics
      @ForceTronics  8 лет назад +1

      +efox29 Good point, although I am not sure that noise would have enough current behind it to turn the transistor on. One way to ensure this does not happen is to add a pull down resistor between the base and ground. Thoughts?

    • @efox29
      @efox29 8 лет назад

      +ForceTronics yup that should work. Then the base is always in a known state and would be more reliable. However, the WDT or better if the microcontroller has access to a reset command like __asm__('reset') then that would be the easiest way to reset. Im pretty sure the AVR has it, not sure if the arduino environment stripped that away or not.

    • @efox29
      @efox29 8 лет назад

      +ForceTronics for some additional info see electronics.stackexchange.com/questions/16143/unnecessary-transistor-and-fet-resistors

  • @chuckthebull
    @chuckthebull 3 года назад

    It seems to me using the transistor is a bit redundant when you could just tie a pin directly given the fact a digital output is simply the output of a transistor already.(don't enable a pull-up so you can still use the reset button).. i even used the reset pin as an analog input with another switch to use as an input (or a hall sensor) but just had it sens a halve voltage and still had the reset pin to do a full reset from,,works flawlessly..Attiny85 limited pins etc

  • @jerryohhh
    @jerryohhh 3 года назад

    how to add a serial port in Arduino Leonardo because mine after install (append) the another code the COM 7 are removing the only available is COM 4 but did not capable to install

  • @thecraftsman8083
    @thecraftsman8083 4 года назад

    Hey did u consider the fact that transistor may conduct enough to reset in case the digital pin 4 gives even lower voltage transient output.

    • @ForceTronics
      @ForceTronics  4 года назад

      I don't quite understand this question? Are you worried about not enough voltage out of digital pins to turn on transistor all the way? BTW I have another video on this topic using Watchdog timer

    • @thecraftsman8083
      @thecraftsman8083 4 года назад

      @@ForceTronics Thanks for the reply! I am rather worried about the transistor conducting even when you don't apply a full +5V to it. Like some transient just after resetting can occur, this transient voltage may not be as high as +5V but lower valued, moving transistor in active region if not in saturation region. Transistor may conduct enough to produce a reset even in active region. Am I correct?
      And yes I saw your watchdog timer video, it was great!

    • @ForceTronics
      @ForceTronics  4 года назад

      Yeah good point. There should be a pulldown resistor on gate of get to prevent it from turning on when it should not

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

    Do you need to reset the code for the new code to work?

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

      I am not sure I understand your question. When you reset a microcontroller the code starts over just a like cycling the power. Unlike a power cycle, a reset only affects the microcontroller or processor it is not going to reset other ICs in the circuit

  • @btno222
    @btno222 3 года назад

    How do I get back into my yun 2 password for setting up its settings back to factory

  • @yxhankun
    @yxhankun 4 года назад

    sorry can't find your code even go to 2016 blog. Please link me there.

    • @ForceTronics
      @ForceTronics  4 года назад

      Go to blog and search on title of the video