#24 Four ways to RESET your Arduino

  Рет қаралды 114,759

Ralph S Bacon

Ralph S Bacon

Күн бұрын

Пікірлер: 193
@anibalesquiembre6699
@anibalesquiembre6699 7 жыл бұрын
Thanksa lot, I was having a lot of problems putting an emergency reset botton into one of my projects. Your explanations were crystal clear.
@RalphBacon
@RalphBacon 7 жыл бұрын
Thanks, Anibal, I'm glad you found the suggestions useful. I hope you find the other videos useful too!
@jbraMoVal
@jbraMoVal 6 жыл бұрын
Going to try this on my project. Hope it works...
@nusretyilmaz1017
@nusretyilmaz1017 2 ай бұрын
I had a problem with my arduino circuit. When i connect my arduino to my PC's USB port or external 5V power supply adapter it was working fine. But when i try to supply with 5V output of my powerbank, arduino never used to reset. I connected 10uF capacitor between Reset pin and GND , started work normally. But, then i realized that, when i attempted the upload to Arduino board, it couldn't upload, because existence of the that capacitor. Every time when i need to upload to Arduino, i had to take off the capacitor,upload program, then had to put it back! Until came acroos your Watchdog timer method. I put the codes to Setup then, ta ta ta taaaa!!! Works perfectly now! Thanks mate, you are life-saver!!
@RalphBacon
@RalphBacon 2 ай бұрын
Glad to hear you got it working. BTW a 10uF capacitor seems too large, a 0.1uF (aka 100nF) is what I use!
@nusyil
@nusyil 2 ай бұрын
​@@RalphBaconafter 10uF i tried 100nf and 330nf as well. Both hadn't worked. Anyway, i don't need them now. Thanks again! 😊
@puterhororlagi
@puterhororlagi 3 жыл бұрын
I searched this tutorial for weeks. this turorial saved my life. thanks sir.
@RalphBacon
@RalphBacon 3 жыл бұрын
Glad it helped!
@RalphBacon
@RalphBacon 8 жыл бұрын
Here are the links to each of the demo code 'ino' sketches. Copy each one to a folder of EXACTLY the same name in your sketches folder. All the following can be found here: www.dropbox.com/sh/sfaav2wqzygy97g/AABuIrOhjRCT_qJwa4mbvz6Ea?dl=0 1. Simple Reset Function (RST) 2. Pseudo Reset Function (not good idea) 3. Watch Dog Timer Reset (best way) 4. Relay Reset for entire project 5. Circuit diagram for Relay Reset Comments? Queries? Suggestions? Leave them below!
@ESLAM-ALUMITAL
@ESLAM-ALUMITAL 8 ай бұрын
Thank you very much for your response I was uploading a specific file to the board and an error occurred when uploading, so the idea of a factory reset occurred to me, and I discovered that the file path was incorrect because I had moved it to another folder, and I remembered that at the last moment, and now it works normally.
@Godshole
@Godshole 3 жыл бұрын
3 days of torment I have been through to get to here and your video. I used to be able to program in BASIC, basic basic, but enough to say 10 is it dark? 20 Pause for a bit and marvel at the moon 30 No, Then GO TO 10 and don't do any thing ELSE ..... AT ALL! 40 Yes? turn on the pump at xxx intervals to water the greenhouse. I cant get in my head the if else system and this reset lets me say 'is it dark?' NO, wait half an hour and check again. And it will clear the board every morning to start the timing cycles so it does not get out of step. Yes I am new to this and this may be a brute force method, but IT WORKS!! All my attempts at if else just ran the whole program irrespective of what I thought it should be doing. SO, thank you so much!! Sanity restored....
@RalphBacon
@RalphBacon 3 жыл бұрын
Start slowly and do experiment a lot with the code. That way comes experience, my young Padawan. May the force be with you.
@pablojavier1908
@pablojavier1908 5 жыл бұрын
The best video ever!! thanks so much, my final project has been done cause of you :)
@RalphBacon
@RalphBacon 5 жыл бұрын
Glad it helped you, Pablo, thanks for posting.
@Poult100
@Poult100 2 жыл бұрын
That's nice to see, Ralph. It assures me the method I used is okay. I had a need to reset the whole project as an OLED display would not always clear and therefore not update following a reset-button press. So I used a monostable flip-flop to supply ground to the whole project (only mA of current required) and programmatically fired the flip-flop when required. At first I was annoyed I had to do that as my previous method was, I thought, very cunning: I had the display mounted directly over the Nano board so that a gentle press on the display would operate the on-board reset button. The displays are only mounted via pins on one edge and so allow that tiny amount of flex. 😊
@RalphBacon
@RalphBacon 2 жыл бұрын
As cunning as a fox who’s just been appointed Professor of Cunning at Oxford University (apologies if you are not familiar with Black Adder). 😄
@Poult100
@Poult100 2 жыл бұрын
@@RalphBacon I absolutely am! Life without Black Adder quotes would be like a broken pencil; pointless! And thanks for the complement 😄
@ESLAM-ALUMITAL
@ESLAM-ALUMITAL 8 ай бұрын
Thank you, great job Is there a way to factory reset the Arduino Leonardo board ؟
@RalphBacon
@RalphBacon 8 ай бұрын
By "Factory Reset" what do you mean? When it comes out off the production belt it normally has the Blink sketch loaded (just to give a visual indication it's all working) but that's almost irrelevant. Can you still upload sketches to the board?
@imdeadserious6102
@imdeadserious6102 3 ай бұрын
I love the idea of the watchdog working to track code being stuck, so im integrating that. However if the stuck portion is due to a sensor or relay i have im actually sending a constant positive 5v signal to an inverter, so if the arduino resets, I get a +5v addition on power transistor triggering a capacitor bank to power a reset relay directly in line with the final connection to all ground, resetting everything down to the input voltage connection. Good stuff!
@RalphBacon
@RalphBacon 3 ай бұрын
I'm happy you found this interesting and useful! 👍
@booksalvation2025
@booksalvation2025 4 жыл бұрын
Hi copied the code exactly but i an using a nano is the watch dog different as it runs the first part and the ends up in rapid flashing
@RalphBacon
@RalphBacon 4 жыл бұрын
A Nano is _exactly_ the same as an UNO (it uses a quad flat-packed version of the ATMega328P but is electrically identical). Which bit runs where and flashes what?
@joey.a3803
@joey.a3803 28 күн бұрын
I connected my arduino to servos and one time I asked chatgbt to modify a code (because I was lazy) but when I uploaded the code it was faulty and I couldn’t overwrite it by uploading another code (it shows that code is being uploaded) but the board still shows that the previous code is running tx is blinking and serial monitor shows yval reading (yval from previous code is analog pin value) l. I just want to remove the code.
@RalphBacon
@RalphBacon 28 күн бұрын
Couple of things to try: 1. Erase the flash entirely and then re upload your new sketch (or just the blink sketch to show it's running) 2. Use the "Arduino as ISP" sketch on another Arduino to write to the dodgy one - this doesn't need the bootloader to be working. 3. Crack open a nice cool beer whilst you investigate these options. Good luck 👍
@joey.a3803
@joey.a3803 28 күн бұрын
@ Thanks for the prompt response I appreciate it truly, I tried all these ( I ordered a new one anyways) but thanks a lot 🤍
@bcer960interurban
@bcer960interurban Жыл бұрын
I have a program (I did not write it) that will not start unless the reset button is pushed. Using a wire to restart the nano at the restart pin works, but I do not know how to program this to only happen once. Also, I need it to happen at the beginning of the program, but not go into a restart loop. I think the watchdog timer "might" work, but I connot find the library you are using in this vid, and do not know enough about the libraries to get another to work. While I realize the problem in most likely in the original program, It is WAY above my understanding of the code. So, my question is, how do I get the nano to reset itself ONCE at the beginning of the code? Thanx
@RalphBacon
@RalphBacon Жыл бұрын
If you don't have the source of the original code, then it's going to be near impossible. But you could have a (for example) 555 timer that issued a single reset pulse after, say, 1 second after power up. Not exactly ideal but when you between a rock and a hard place...
@bcer960interurban
@bcer960interurban Жыл бұрын
I had thought about that, and it would take a 556 to make it work. I was hoping I was doing something wrong with the watch dog timer, as it has errors when I try to compile it
@edgarblumenfeld9479
@edgarblumenfeld9479 4 жыл бұрын
Hello Ralph. Im having a problem with using a pin as a means to reset the board by setting it LOW in the code. As you did I'm setting it HIGH absolutely first thing in the Setup, however when I plug it in, the board goes into a kind of boot loop and doesn't start. If I disconnect the pin from RST and start the board again it works. AND (this is I think the interesting bit) if I turn the board and AFTER that I connect the pint to RST it works like a charm. It almost feels like the setting it HIGH very first thing on setup is not doing it fast enough and the MC is seeing it low before it can change it. THANKS!
@RalphBacon
@RalphBacon 4 жыл бұрын
Hmm. Odd. Before you set a pinMode to OUTPUT or do a digitalWrite(x, LOW) in Arduino-speak, all pins are set to (high impedance) input. I _suppose_ that might be enough to trigger a reset. Change the order of the statements in your code: set the digitalWrite to HIGH _first_ which will make that pin an INPUT pin with PULL-UP (so no chance of a reset), and _then_ set it to OUTPUT, HIGH, which still keeps it high but as an OUTPUT. If you have scope, you can check what you get on the RST pin. More likely is that the pull-up resistor on your reset pin is not strong enough. Try putting a 10K resistor from VCC to RST to see if that keeps it high for long enough. Next step is to additionally, put a 1µF capacitor between RST and GND to keep it high even when it tries to go low (for a few milliseconds, anyway). If any of these solutions work, (a) let me know and if you used a component (b) try and increase the resistor (up to 47K) and decrease the capacitor (down to 0.1µF) and see how far you get. You didn't mention which board you have (I'm assuming an UNO) but some clones may have weak pull-ups (you can measure it on your board if you have a multimeter). Let me know either way, I'm intrigued.
@edgarblumenfeld9479
@edgarblumenfeld9479 4 жыл бұрын
@@RalphBacon ​ Ralph S Bacon Hello Ralph! Thanks for your response and your time. I followed your suggestions and the problem unfortunately persists. What I'm seeing is suggesting to be something related to the use of programmatic reset and the serial port. I still haven't put my finger on it...so far the best results were using a capacitor between ground a restart. I think the answer may lay here: playground.arduino.cc/Main/DisablingAutoResetOnSerialConnection/playground.arduino.cc/Main/DisablingAutoResetOnSerialConnection/
@ayganotomasyon1109
@ayganotomasyon1109 10 ай бұрын
Hi I have a problem which I cant find a solution for a month. I have a code pulsing a stepper until a switch is pressed then delay for 500mS then stepper runs CCW . Code runs without any problem for 100 or more times but by unknown reason arduino freeze as the switch is pressed. I tried several switches as well as in NC or NO condition. Arduino needs to be reset by pressing reset button or power off. I plan to reset arduino in every cycle with your second way in the video. Do you have an opinion why arduino freeze by a very simple code randomly?
@RalphBacon
@RalphBacon 10 ай бұрын
Not without seeing your code. Either post a small example here that shows (and exhibits) the issue or drop it somewhere on-line and I will look at it.
@ayganotomasyon1109
@ayganotomasyon1109 10 ай бұрын
thank you so much . drive.google.com/file/d/1nyhgRnnwfrM0bD2MXE3DUCuwT3R9F3VQ/view?usp=sharing @@RalphBacon
@RalphBacon
@RalphBacon 10 ай бұрын
You really need to add some Serial.println statements in critical parts of the sketch. That way you will see which bits are running. Also put a delay(250) in the main loop so you are not flooded with these debugging statements. Where you indicate it "hangs" is unlikely; hence my suggestion of putting Serial.println statements at various points, that way you can trace the program flow.
@eliotcougar
@eliotcougar 4 жыл бұрын
I've got here after watching your newer video about an external wd timer and researching how to restart my device if it hangs due to random interference happening... Whilst researching the topic I found that if you use wdt on some Arduinos, like Mega2560 for example, after the first restart it goes into bootloop, because on init it sets its wd timeout to the lowest setting (15ms) and doesn't have enough time to reach even the beginning of the setup() code until wd triggers restart again... The Mega clone I had did just that... There is a lot of conflicting information on the Internet for the workarounds: 1. to replace bootloader, 2. to get rid of bootloader entirely, 3. to add a function with some compiler attributes so it executes very early and disables wd, and so on... And some mention that it no longer applies to newest revisions of the boards (but may still be relevant in case of Chinese clones and older boards with legacy bootloaders) In a lot of places that mention the third option, there is a small mistake in the code, I suppose, and people say it doesn't work... void get_mcusr(void) __attribute__((naked, section(".init3"))) { MCUSR = 0; wdt_disable(); } When compiled in Atmel studio (what the smart guy who originally shared this workaround uses, I suppose), it works okay... However, if you add a function like this to the Arduino sketch, it will be optimized out of existence, and a lot of people with boards in a bootloop will comment that it doesn't work... Someone forgot to add ((used)) attribute...
@RalphBacon
@RalphBacon 4 жыл бұрын
Surely the solution is to ensure the fuse bit (WDTON) is *not set* for the WDT, so that it is ONLY set by software. That way, it is not active on boot and only comes into play once the sketch starts running?
@eliotcougar
@eliotcougar 4 жыл бұрын
@@RalphBacon It is never active on boot, unless the reboot has been triggered by the watchdog... If you set the wd, and then reboot manually before wd triggers, it's okay, wd is not set right away... If it was set, and triggered, it stays set, but the timeout setting gets reset to 15ms...
@RalphBacon
@RalphBacon 4 жыл бұрын
In that case a workaround is to intercept the WDT reset (in the ISR), cancel the reset and then do a manual reset? But that 15mS sounds crazy (unless you don't have a bootloader, of course which I often remove to get rid of the start up delay).
@eliotcougar
@eliotcougar 4 жыл бұрын
@@RalphBacon Well, it looks like adding a function that disables wdt to .init3 section also works... If I understand it correctly, it's between stack initialization and static memory initialization... So, very early on... You just have to make sure linker doesn't delete it...
@eliotcougar
@eliotcougar 4 жыл бұрын
@@RalphBacon Also, I don't think it's a good idea to do a manual reset in the WDT ISR, because it will not fire if the main program hangs inside another ISR... I think that can often happen when you have bad I2C connection for example... That's how I artificially trigger hanging - wiggle CLK connection for 3 seconds, and the whole board gets stuck...
@jakariasbulldozer9086
@jakariasbulldozer9086 5 жыл бұрын
can I use transistor or mosfat insted of relay ? if so wich cheap one
@RalphBacon
@RalphBacon 5 жыл бұрын
Yes, you can, Jakaria. Watch my video #123 which should give you some ideas.
@jakariasbulldozer9086
@jakariasbulldozer9086 5 жыл бұрын
@@RalphBacon i use 2n2222 and just add a1k resister on its gate.. it works beautifully... thanks I got clue from your video
@RalphBacon
@RalphBacon 5 жыл бұрын
Cool, and congrats on getting it working.
@johnmarshall2660
@johnmarshall2660 3 жыл бұрын
This video just happen to pop up when I was adding a panel to a Mega and a Nano that I am using to control a section of my Model Railway at moment I just added pushbuttons to a Mimic panel with 2 RESET buttons, the Mega I am using controls Inputs from 11 IR sensors and outputs to 14 Points and 7 Signals and a 11 signal to trigger a route on a Nano which is on a Mimic Panel A4 sized PCB with Bi-Colour LED's and 14 Push Buttons for route selection, sometimes both Mega and Nano do incorrect things and unless I reset it stays like that so the WDT would work I think but all the routes are in a Switch Case, 9 cases on both Mega and 11 on the Nano plus I have most pins used on the Mega but pins A11 to 14 and Data 1 to 4 and 14 to 21 are available but not A0 to A10 these are output triggers for the Mimic Nano so could I add in a switch case ... if so where abouts ...thanks for any help ...Regards John
@RalphBacon
@RalphBacon 3 жыл бұрын
I hacked into your camera, John, and knew what you were doing! Perhaps you need my external watchdog circuit to reset things? kzbin.info/www/bejne/rZS1pomujdF4gdk I might even have a PCB for it.
@johnmarshall2660
@johnmarshall2660 3 жыл бұрын
@@RalphBacon Hi Ralph ... thanks for video ... I have used a similar circuit without the output Mosfets on a few occasions ... I did send you a video and message on Messenger but not sure if you ever look on it ... also check out a file which went on Github for the 20 channel Arduino switch github.com/MERG-DEV a member of MERG designed the sketch for me ....I used as a 10 channel ... I want to get this layout in a Shed which I got material recently 5mtrs x 3.5mtrs but a slipped disk has made things impossible at the moment ...
@davidcyr951
@davidcyr951 2 жыл бұрын
These reset techniques assume the Arduino is still operating properly and is not corrupted. However, an ATtiny85 gets corrupted with a brownout condition where the ATtiny85 thinks it's still OK and doesn't reset/restart, but in fact the code has become corrupted and produces bad PWM output, or none at all. The code we added to detect an invalid PWM signal out seems to be corrupted as well, so the techniques you describe don't help in this case. Is there a simple external circuit that we could use to detect that the supply voltage has dropped below the minimum specification and invoke a reset by pulling the reset pin to ground? It would be perfectly OK to have this circuit reset on a normal start up as well, i.e. whenever the supply voltage rises to within spec from a below-spec level. Or any other suggestions that would reset/restart the ATtiny85 without relying on the Arduino code?
@RalphBacon
@RalphBacon 2 жыл бұрын
Yes, you need an external monitor reset circuit. Basically, the Arduino (or whatever) sends a regular signal out on one of its pins. This is detected by the external circuit that is constantly trying to reset the Arduino but is prevented from doing so by this stream of pulses. If the Arduino hangs, the pulses stop and the Arduino gets reset. I've done a video on this, works like a dream: video #190 describes it all (kzbin.info/www/bejne/rZS1pomujdF4gdk ) video #194 shows the PCB circuit and shows it working (kzbin.info/www/bejne/jaHMmX-Gq75sd8U )
@davidcyr951
@davidcyr951 2 жыл бұрын
@@RalphBacon Since sending my question, I found out that Arduino processors have a brownout detector that accomplishes recovery from a drop in Vcc where the code stops functioning properly. The BOD can be turned on from the "Tools" drop-down menu of the Arduino IDE. Select the threshold voltage level and burn a bootloader in the same "Tools" drop-down menu. Fixed my problem...
@wyldrushorchard1061
@wyldrushorchard1061 Жыл бұрын
Thanks for great and very clear video! Given this is 7 years ago I would understand if its 'out of support' but I have made use of wdt to reset the arduino (uno wifi) but currently only enable the wrt when it gets a reboot request from web server via a php post response. It would be nice to have it running to catch at all times any other lock ups. My question is if this is a bad idea when I'm using wifi libraries that are likely to block? I did wonder about timer interrupt to 'kick the dog' but then that might corrupt wifi operation? Any thoughts?
@RalphBacon
@RalphBacon Жыл бұрын
I designed an external watchdog (lovely circuit, very simple, works like a dream). It must get a series of pulses (eg from the loop) to keep it from temporarily disconnecting the whole power supply (or as much of it as you want). See video #190 kzbin.info/www/bejne/rZS1pomujdF4gdk and #194 kzbin.info/www/bejne/jaHMmX-Gq75sd8U where I show (off) the PCB!
@rolandtv8191
@rolandtv8191 4 жыл бұрын
Hi Mr. Ralph, how to copy the old program of old arduino to a new arduino.Your prompt response is highly appreciated...Thanks a lot
@RalphBacon
@RalphBacon 4 жыл бұрын
Just create a new sketch then copy and paste all the code from the old sketch into the new one. Give it a new name and save it. Job done. Hmm. Re-reading your post makes me think you have an actual Arduino with code loaded that you want to load (clone) into another Arduino. Whilst you can do that using AVRDUDE that will read the contents of an Arduino (assuming it has not been locked to prevent this) you will end up with a hex file of goodness knows what that you can then load into another Arduino. Look at post #7 in this thread: forum.arduino.cc/index.php?topic=123805.0
@tomislavhanzekovic5812
@tomislavhanzekovic5812 3 жыл бұрын
Thank you for your tutorial, it is very useful. But I still have one question about "Watch Dog Timer Reset". I use arduino in hard enviroment (near contactor for motor 1,1 kW), and every day arduino stop working and need reset. If I put in code "Watch Dog Timer", and before timer elapse, contacor make electromagnetic field and arduino stop working, Watch Dog Timer will stil do his task (although, the Arduino doesn't work)??
@RalphBacon
@RalphBacon 3 жыл бұрын
It _might_ be OK as the watchdog timer is an independent part of the chip, but if the Arduino μController is latched it might not work. What you really want in this case is the *external* reset circuit I published in videos #190 (kzbin.info/www/bejne/rZS1pomujdF4gdk ) and again (with PCB) in video #194 (kzbin.info/www/bejne/jaHMmX-Gq75sd8U ) which is a joy to use and very simple too, though I say it myself. Shielding the Arduino in a metal case might work too, or decoupling the power supply very well.
@theshiv530
@theshiv530 3 жыл бұрын
Does hardware reset from program clears all ram means dynamic does it really empty all memory
@RalphBacon
@RalphBacon 3 жыл бұрын
All SRAM memory is in an undefined state; it may (and probably does) contain fragments of the previous program variables but as far as the microcontroller is concerned it is all fresh and available for use. Obviously, non-volatile memory, such as your program (sketch) and EEPROM, remain untouched.
@theshiv530
@theshiv530 3 жыл бұрын
Thank you for your reply sir
@AikoPrasTrains
@AikoPrasTrains 3 жыл бұрын
Thanks for the very useful video. Well done! While testing it on the various boards I have, I run into two problems. The first is that it didn't run well on "modern" AVR controllers, such as the 4809 (Nano Every) and (likely) the new DA128 variants. The reason is the changed names and values for the WDT timeout values. A simple solution is some conditional code, like: #ifdef __AVR_XMEGA__ // Tested on Nano Every (4809) wdt_enable(WDT_PERIOD_2KCLK_gc); #else // Tested on Arduino UNO and Mega (328 and 2560) wdt_enable(WDTO_2S); #endif A second problem is the fact that the code will lead to eternal resets on boards with older, none Optiboot boot-loaders, or boards without a boot-loader. The reasons for that has already been discussed by earlier comments on this video (the solution is to clear the Watch-dog System Reset Flag (WDRF) and the WDE control bit in the initialisation routine). But again, thanks for this great video!
@RalphBacon
@RalphBacon 3 жыл бұрын
Yes, I'm not surprised but then again the "modern" AVR controllers you mention didn't exist when I made this video, so thanks for the code update for others to read too. I'm not even sure Optiboot was standard back then... such is progress.
@AikoPrasTrains
@AikoPrasTrains 3 жыл бұрын
@@RalphBacon Sure, new microcontrollers continuously appear, probably to keep us busy ;-) Just for information, in case people run into the same issues. For testing purposes I added, in the beginning of setup(), some code to clear the Watch-dog System Reset Flag (WDRF) and the WDE control bit. On boards without eternal resets. So on Arduino's with old
@MaazQaiser
@MaazQaiser 5 жыл бұрын
How can i do through Labview. Can i set one button there to reset my arduino ? Please reply
@RalphBacon
@RalphBacon 5 жыл бұрын
I'm sorry I don't have any experience of Labview.
@davorbuklijas1527
@davorbuklijas1527 5 жыл бұрын
Hello I have a question. I loaded arduino with step motor program. I have 5 V for logic part and 12 V motor supply. Now when I connect only usb sequence begins in arduino and 12 is still unplugged, I wonder is there a way when I plug 12 V to motor (over driver tcm2100)to restart arduino board so the sequence restart.
@RalphBacon
@RalphBacon 5 жыл бұрын
You want the Arduino to reset when the 12v is plugged into the motor circuitry? OK. If you take a voltage divider feed from the 12v (to bring it down to 5v) into a digital GPIO pin you can detect this and force a restart. To bring the 12v down to 5v you need a 12K resistor from 12 to the GPIO pin. From the GPIO pin, you need a second resistor of 8.2K down to ground. This will give you about 4.8v which your GPIO can detect and reset the Arduino. YOU MUST use both resistors or you will destroy the GPIO pin (and perhaps more). 12v ------------------ to Motor | ■ 12K resistor | | -----> to Arduino GPIO pin (high = 12v attached) | ■ 8K2 resistor | GND ----------------- to Motor You will have to work out how to stop the Arduino constantly resetting though, as the GPIO pin will remain HIGH for as long as the motor 12v supply is attached. Perhaps only reboot if the pin was LOW initially and then went HIGH. So if HIGH immediately do not reboot. That should work just fine.
@davorbuklijas1527
@davorbuklijas1527 5 жыл бұрын
@@RalphBacon thank you very much for the answer. I am going to try with this tips. Just one more question. When I plug both supplies my motor spin few steps randomly after that program starts. Any tip how to fix that... Thanks again you really helped me.
@RalphBacon
@RalphBacon 5 жыл бұрын
Are you ensuring you have stopped the motors before you plug in the 12v? Perhaps they are are not set to stop running? A bit like after setting "pinMode" you must execute "digitalWrite" so the Arduino knows what to do with the pin. Maybe the same with your motor controller? Is there a command to say "stop"? Good luck!
@FOATE
@FOATE 5 жыл бұрын
Once again solid info! This is gonna come in very handy. I would like to add that the arduino feezing could be caused by trying to send too much serial data through the port without using a flush. Appearantly the memory gets full after a while and this is remedied by adding Serial.flush(); to the end of your code. For me it seems to work so far, the device is going strong for 12+ hours while it usually stops after 6, so fingers crossed. It also seems to work for my Wemos wich having a few minutes timeout after every 3 to 4 times sending data. This may not be the ultimate fix though but at least I know what to do if the fush doesn't work. Thanks for sharing!
@RalphBacon
@RalphBacon 5 жыл бұрын
You are most welcome dikke j, I'm glad you like the video. Nice to hear from you.
@markanthonynilo9198
@markanthonynilo9198 9 ай бұрын
I didn't watch the entire video yet. I'm trying to reset my arduino inside a project case, Can you reset arduino via Serial Monitor Command?
@RalphBacon
@RalphBacon 9 ай бұрын
You can bring DTR/RTS low to reset the Arduino but you might as well just bring out the EN (aka RESET) pin and short it to ground to reset the device (momentary push button works well).
@oralbarkay370
@oralbarkay370 6 жыл бұрын
Hello, What I wanted to ask was when you reset with program using the rstPin, any globally declared variables still stay in memory. My intention is when the REST is done via software everything to be wiped out and starting the card as if the electricity has been taken out of card. Is this possible?
@RalphBacon
@RalphBacon 6 жыл бұрын
A reset is a HARDWARE reset so that everything indeed starts as though you had just switched it on, starting with the "setup" function and then running the "loop" functions. Nothing is retained across a hardware reset except things you have stored in EEPROM. I hope this helps.
@oralbarkay370
@oralbarkay370 6 жыл бұрын
Hello again and thank you for the answer. That is exactly my point. When I tried the method you suggested to RESET via SOFTWARE that is using the rstPin(which was the second method) I came across a very interesting thing. The cards resets all right but the global variables such as arrays I have defined is stored in the memory exactly as they were. So I had to find a method to actually initialise them back to their created states. i.e. I have an int array that stores 50 values in it. When the card is electrified this is created on top of the program and all values default to 0. Then I load some values in it inside the loop. Then when I apply the software reset, the card seems to reset itself but the array values which was declared on top (before setup and before loop) stays the same. If you can actually re generate this maybe this will be help for all the others when they came across this situation they would know that they need to re initialise the values they have crated as a global variable or an array manually otherwise the previous values will stay in the memory unless they actually push the reset button or take out the electricity from the card. If I am right this will be a contribution as I could not fine anything else on the subject than what you showed here. Once again thank you
@RalphBacon
@RalphBacon 6 жыл бұрын
OK, I see where you are coming from, but it's purely a side-effect of restarting. The volatile RAM is in an indeterminate state, initially. Basically, it's random garbage. After a reset though, you have placed stuff in memory from the pre-reset state - and there is no routine that clears it down, so the memory may well contain your old data - but it is NOT linked to any variables running in the sketch; the compiler will assign new memory locations for each variable (which may well be the old locations, of course) but will reinitialise with the value you supply. If you don't set an initial value then it will contain random values (but that could be your old, pre-reset values). But this is then down to sub-optimal code: if it's important that your arrays, ints or whatever are initialised then initialise them in the setup! Does all this make sense? Is this what you mean?
@EnergeticWaves
@EnergeticWaves 4 жыл бұрын
avr/wdt.h: No such file or directory
@EnergeticWaves
@EnergeticWaves 4 жыл бұрын
oh, funny thing, if I put an Arduino board in the i d e now it finds it.
@RalphBacon
@RalphBacon 4 жыл бұрын
Glad you got it working!
@EnergeticWaves
@EnergeticWaves 4 жыл бұрын
@@RalphBacon I love your videos. Keep them coming.
@daviddoidge1252
@daviddoidge1252 4 жыл бұрын
Hope you are well. Would solution "1. Simple Reset Function (RST)" work on an Arduino MKR WIFI 1010 ?
@RalphBacon
@RalphBacon 4 жыл бұрын
Well it has a RST pin, David, so I don't see any reason why not. If you connect RST to GND does the device reset? (Rhetorical question, it does). So by using a GPIO on the device as per the demo, it should work the same. Remember that using the WDT you get the same effect but save a pin, though! Have a go!
@daviddoidge1252
@daviddoidge1252 4 жыл бұрын
@@RalphBacon Great to hear from you. Having connected Reset to a GPIO pin I thought I was having problems with the 1010 not starting but it seems to have been an issue with multiple comm ports with the same number !!! Once I picked the correct one I could see the Serial Monitor print out so I knew it was working. If using the watchdog timer, is it possible to get 24hrs before resetting ?
@RalphBacon
@RalphBacon 4 жыл бұрын
Glad you got it working after finding the correct port! I'm afraid the WDT is used _primarily_ to ensure to ensure your program has not hung (or got itself in a state that it is stuck in some loop, perhaps waiting for input etc). So you would expect that the WDT period is short (anything from 64mS to 8 Seconds). What you have to do is set it for 8 seconds, and everytime the WDT kicks in, check a count, add 1 to it and move on. When the count exceeds 24 hours = 1440 mins = 86400 seconds which is *10,800 eight-second intervals* , give or take, allow it to do the reset. Sounds clunky but it's the way we do it!
@daviddoidge1252
@daviddoidge1252 4 жыл бұрын
@@RalphBacon Thank you again. I will have a go at reprogramming it, probably in the morning after the carling has worn off :) . Hope you and your family (and animals) are all well.
@wowshamanful
@wowshamanful 5 жыл бұрын
Hello, @Ralph S Bacon Will the first method RESET just the arduino board? What if other peripherals are connected on it like a display for example? Will the method cut the peripheral's power as well? Thanks in advance,
@RalphBacon
@RalphBacon 5 жыл бұрын
Resetting the Arduino doesn't stop the power anywhere (assuming you are using the +5v pin on the Arduino to power your other devices). To do that you must use a MOSFET pair to switch off the power to your other devices and back on again, programmatically, so controlled by the Arduino. See my video #123 for ideas. Very easy to do. Also this week's video (out Friday) expands on that, could be useful to you too.
@wowshamanful
@wowshamanful 5 жыл бұрын
@@RalphBacon Thanks for the reply! Is there a way of doing it explicitly via code w/out using external components? (Earned a sub btw)
@RalphBacon
@RalphBacon 5 жыл бұрын
Glad you subbed, welcome! You can't power off the Arduino without external components but resetting the board is done via the WDT (Watch Dog Timer) which I showed. Other parts of the circuit would be unaffected by this which can cause them to misbehave. Is this what you mean, Christofer?
@wowshamanful
@wowshamanful 5 жыл бұрын
@@RalphBacon Hi again, what I meant was to completely reset the project not just the board. Suppose I am using an Arduino UNO connected to an OLED and a sensor. On the OLED I am plotting sensor values. When I press reset, the display clears and when it reboots, before plotting again the sketch from the beginning the last bit of information which the OLED was showing appears again (before booting up normally again). Understandable?
@jeffbluejets2626
@jeffbluejets2626 5 жыл бұрын
Hi Ralph, did the same thing as your No.1 approach a while back using a pro mini clone and pin4 but for some reason, while the link is on, the arduino will not program. No great bother as I simply remove the link, re-program, then refit the link and all works great. Any ideas why this would be the case?
@RalphBacon
@RalphBacon 5 жыл бұрын
From what I can recall, Jeff, from this most excellent video (heh heh) is that if you connect anything to the RST pin (eg another GPIO) then the programmer might have difficulty bringing that pin LOW for a few milliseconds to get it into the correct state for uploading code. Did you connect the Pro Mini's GPIO pin 4 _directly_ to RST? Try using a diode (eg IN4001) from pin 4 (cathode) to RST (anode) and see if that cures the issue. And whether it can still reset the Arduino from code. If that doesn't work then using a small MOSFET would work, eg a 2N7000: drive the MOSFET's Gate HIGH from the GPIO pin 4, the Drain goes to RST and the Source goes to GND. That will cause the RST to be "shorted" via the MOSFET to ground, thus resetting it but should still allow the Arduino to be programmed. Let me know if you ever try any of these ideas!
@jeffbluejets2626
@jeffbluejets2626 5 жыл бұрын
@@RalphBacon Hi Ralph, Yes, the diode solution works great for programming and I still get my required software reset. Did not try the mosfet idea but I imagine that would work equally well. Thanks again for your time and assistance. Greatly appreciated.
@RalphBacon
@RalphBacon 5 жыл бұрын
Glad I could help, Jeff! Thanks for letting me know, that's great.
@ankansharma4897
@ankansharma4897 5 жыл бұрын
Sir, i uploaded a malicious code to arduino pro micro. But now i want to change the code and upload a different code. But as it contains malicious code it brings down my pc. Is there anyway that i can delete the whole code physically so that it doesnt effect my pc. Plz reply its urgent
@RalphBacon
@RalphBacon 5 жыл бұрын
I'm baffled, Ankan, as to what you mean by "malicious code"? I cannot image what you have uploaded (other than to turn it into a rogue keyboard emulator that is typing random characters into your PC before you can upload a new program). If this is the case, find the keyboard in your list of hardware items and disable it - that will prevent it sending anything more to your PC. Just make sure you pick the correct keyboard or you will lock yourself out of your PC.
@ankansharma4897
@ankansharma4897 5 жыл бұрын
@@RalphBacon actually i have programmed arduino pro micro into usb rubber ducky(actually it acts a keyboard and so code in such a way that it gives adminstration access and different thing. Its a hacking tool). I want to upload a different code so want to disable the code while further editing
@RalphBacon
@RalphBacon 5 жыл бұрын
Frankly I think this is Karma in action!
@ankansharma4897
@ankansharma4897 5 жыл бұрын
@@RalphBacon cmon man ethical hacking is part of learning. Dont keep such outdated mindset
@blt2012
@blt2012 8 жыл бұрын
Can you also reset the Arduino by using the relay to connect gnd to reset pin by turning a pin high to activate the relay?
@RalphBacon
@RalphBacon 8 жыл бұрын
+blt2012 well, yes, you could do that but there's no need as you might as well bring the reset pin LOW by connecting it to another output GPIO pin and driving that LOW. Have I understood your question correctly?
@blt2012
@blt2012 8 жыл бұрын
Okay thanks. That makes sense. I am building several Arduinos that would be connected using xbees and wanted all of them to be reset by one master. With your video help it should work.
@RalphBacon
@RalphBacon 8 жыл бұрын
If do it the way I suggested above remember to set the OUTPUT of the GPIO pin HIGH before you even set the pinMode otherwise you will immediately reset your Arduino! Otherwise the relay would work too.
@_GummyBear_
@_GummyBear_ 5 жыл бұрын
can you help me on this error pls? avrdude: stk500_getsync(): not in sync: resp=0xdd
@RalphBacon
@RalphBacon 5 жыл бұрын
It probably means, Sandro, you have not defined either the board or port correctly. Go to Tools and check that you have the correct board (and processor) selected and that the correct port is selected.
@_GummyBear_
@_GummyBear_ 5 жыл бұрын
@@RalphBacon i tryed that and for nothing. the error appear after the upload dunno what to do
@RalphBacon
@RalphBacon 5 жыл бұрын
That can't appear _after_ the upload, it appears as it tries to _carry out_ the upload. Try a different USB cable. Check that the port you have used is correct (from Device Manager -> Ports).
@dzee9481
@dzee9481 5 жыл бұрын
Mr. Bacon, I like the idea you mentioned resetting the entire arduino and sensors maybe including and SD card. For example the W5500 Ethershield or the ESP32 Wifi module stopped responding cause by poor output from WiFi router. The question I have is your code is a basic template to resetting the arduino sort of. I would ask if that was the case how would one code up such a procedure such that you feel it is doing it correctly. I am picking on a WiFi device connected to the arduino not responding.
@RalphBacon
@RalphBacon 5 жыл бұрын
If your WiFi module is not responding (correctly), Don, and you can detect that from the Arduino, you can just use the WDT method to reset your Arduino. That's what I do with an ESP8266 device; if I cannot get a response from a particular site, I try 10 times over a period of about 1 minute and then let the WDT reset the device. Works like a charm.
@evertkramer7518
@evertkramer7518 4 жыл бұрын
Bedankt thanks i was just working on this because i had a program that occasionally crashed. With a normal arduino it never happens but the imitation Arduino gives problems.
@RalphBacon
@RalphBacon 4 жыл бұрын
It could be poorer voltage regulation / interference rejection on the PSU side, or missing decoupling caps.
@rajeshbiradar8450
@rajeshbiradar8450 6 жыл бұрын
Hiii i am beginner...arduino uno. Error process returned not zero result code 1 what i do???? I can't upload my new programming... And TX led always ON...
@RalphBacon
@RalphBacon 6 жыл бұрын
Hi Rajesh. Have you connected your UNO with a standard USB cable to your PC? Have you identified the correct port (I'm assuming Windows here, correct me if you are using Linux)? Can you successfully upload the example BLINK sketch to your UNO?
@rajdeepdas86
@rajdeepdas86 3 жыл бұрын
Extremely helpful video. Thanks a lot.
@RalphBacon
@RalphBacon 3 жыл бұрын
You're welcome!
@hind2202
@hind2202 7 жыл бұрын
please I forgot the password of my Yun card, I can't reconfigure it or reprogram it, what can I do to have it back ?
@RalphBacon
@RalphBacon 7 жыл бұрын
Well, Hind هند, you could just throw it in trash bin. Or, better, follow the steps in this thread (second post) which describes exactly how to reset the Yun password. forum.arduino.cc/index.php?topic=300800.0 Yes, Google can be your best friend in time of need!
@balaji9489
@balaji9489 5 жыл бұрын
thank you for ur wonderful explanation sir ,, i need to reset arduino only when i press "*" key in keypad ,how can i go with this sir, can u please tell me
@RalphBacon
@RalphBacon 5 жыл бұрын
You need to send serial data to the Arduino from your PC. Then the Arduino can react to that data and reset itself. But I cannot help you writing the Windows / Mac / Linux program that will send serial data to the Arduino via the USB port, that you must research yourself. Then you can read this link: www.arduino.cc/en/Tutorial/KeyboardSerial Sorry I cannot be of more help, Bala, but you will have fun investigating this I am sure.
@balaji9489
@balaji9489 5 жыл бұрын
@@RalphBacon thank u a lot sir,, i will go with your valuable words
@colmbrazel
@colmbrazel 3 жыл бұрын
Great video thanks. In the course of implementing your solution connect reset pin to pin 7, I found some stray wires had gone from my pin 6 wiring to reset pin. That fixed my avrdude problem but great to have your solution if I need it.
@RalphBacon
@RalphBacon 3 жыл бұрын
Nice work! Always good to find a solution to a problem.
@katiehultay7800
@katiehultay7800 5 жыл бұрын
Hi, thanks for making this video. I have run into a ISR conflict when trying to use the Entropy library with Watchdog (for resetting). Do you think it’s possible for me to resolve or do I need to pick only one? Thanks again.
@RalphBacon
@RalphBacon 5 жыл бұрын
Hmm, what's an ISR _conflict_ Katie? What is the error message you're getting? If you can describe that plus what it is you're trying to achieve that would be good.
@katiehultay7800
@katiehultay7800 5 жыл бұрын
@@RalphBacon I had 'vector 6' redeclared. I was able to fix it after a good nights sleep. Thanks again for making this informative video. Much appreciated!
@RalphBacon
@RalphBacon 5 жыл бұрын
Glad you found a fix and that you like my video! Thanks for letting me know.
@j1952d
@j1952d 3 жыл бұрын
I suggest another method - using WDT, (but only to reset). Include WDT, and start off with WDT disabled. Write program as usual, ignoring the WDT. When you want to reset, call a reset() function, which enables WDT at 15ms, then does a "do-nothing" loop (or a delay()) until the WDT triggers and resets the Arduino. Job done.
@RalphBacon
@RalphBacon 3 жыл бұрын
Sound good, John. I haven't tried this but I guess you must have so we will add it to the list.
@j1952d
@j1952d 3 жыл бұрын
@@RalphBacon I confess I hadn't tested it on an Arduino (tho' I did similar things on other systems years ago). Got your reply and finished my pint, then came home and did some tests. Up a blind alley for an hour or so, as neither your WDT reset nor mind worked - after the timeout, the LED flashed at about 5Hz, and things jammed up. I was testing with a knock-off Chinese Nano, so I had a sausage sammige, then dug out an Elegoo Nano (nearest I've got to something genuine, except some Nano Everys and Seeed Xaios in a box somewhere). Long and short - both your and my techniques worked as expected.
@RalphBacon
@RalphBacon 3 жыл бұрын
Whilst I'm delighted you got both solutions working, I'm perplexed why anyone would make a fake Arduino chip! A fake Intel i9 octa-core I could understand, but an Arduino? 🤷‍♂️
@j1952d
@j1952d 3 жыл бұрын
@@RalphBacon it's not the chips, it's the board. Original Nano from Arduino is currently €18.00. You can get 3 or 4 knock-off Nanos for that (same chip).
@RalphBacon
@RalphBacon 3 жыл бұрын
I've only ever bought a handful of original Arduino-style boards (in an effort to support the Arduino corporation). So all of my other boards are clones (which they are entitled to do, it's Open Source); in fact, I've made several of my own boards for Nanos and the like which you may have seen on this channel. The board should not stop the device working - my barebones Arduino design shows that just 5 components and a bare ATMeaga328P will get you up and running. I'm guessing that something else is afoot with those boards!
@rohitvekariya602
@rohitvekariya602 7 жыл бұрын
its not work on arduino uno what i do????? please helpme
@RalphBacon
@RalphBacon 7 жыл бұрын
Now, Rohit, there are four different 'reset' methods described in this demo. Which one did you mean, what problem are you experiencing and what, if anything, is displayed in your debug window?
@rohitvekariya602
@rohitvekariya602 7 жыл бұрын
thx for reply i use first methods problem is i connect reset pin is pin number 13 reset pin connect to pin 13 before uploading program then arduino not program and i also try pin connect after upload program but problem is whenever pin 13 low then arduino is going to reset mode but not reset after removing connection between reset pin and pin 13 then arduino reset its behavior like press continuous reset button after release button arduiino reset
@rohitvekariya602
@rohitvekariya602 7 жыл бұрын
i want to reset arduino because i try to synchronize two separate arduino in rgb led it synchronize up to 10 minutes after 10 minutes minor chip delay occurs between two arduino then some color different occurs so what i do if u have any idea in rgb led please suggest me i want to synchronize two rgb led both are separate arduino with separate power supply
@RalphBacon
@RalphBacon 7 жыл бұрын
I think I can understand this. You should not use Pin 13 to connect your RST pin as pin 13 controls the on-board LED and is used by the bootloading process. Use another GPIO pin that you control, eg pin 12. However, if you want to synchonise two Arduinos you really need to consider one of them the MASTER and one of them the SLAVE. They must be connected by a GPIO pin and GND. Your MASTER sketch controls all the RGB work. It sends out the 'clock' signal to the SLAVE Arduino that it is time to show the correct/next RGB colour. The two sketches will be different - the MASTER must send the signal (eg setting the GPIO pin HIGH, the SLAVE must be listening to this PIN state (perhaps on an interrupt pin) and only then show the RGB colour. This way the two Arduino will not get out of step. If connecting the two Arduinos with a wire is difficult you could use infra red transmitter (MASTER) and infra red receiver (SLAVE) instead, or even wireless. What do you think?
@rohitvekariya602
@rohitvekariya602 7 жыл бұрын
thanks for reply both arduino has a same program i want to make two small rgb light for home . between to arduino does not having any connection both are separate ,its work upto 10 minuets but every controller having oven delay due to this is not synchronize so i want both arduino after 5 minuets reset
@fernandoazevedo8452
@fernandoazevedo8452 5 жыл бұрын
Can you give me the library avr/wdt.h ?
@RalphBacon
@RalphBacon 5 жыл бұрын
This is a standard Arduino library, Fernando. On my PC I found it in this folder: C:\Program Files (x86)\Arduino\hardware\tools\avr\avr\include\avr
@JamesFraley
@JamesFraley 4 жыл бұрын
Great video!! very helpful.
@RalphBacon
@RalphBacon 4 жыл бұрын
Thanks, Jim, glad it was of help.
@kiranshashiny
@kiranshashiny 4 жыл бұрын
My Arduino Uno serial port on the board is broke ! It used to work but not now, I know the. 1) Mac OS / Laptop is good, no changes there. 2 ) CH340G is good - no changes 3) Serial Cable is good - nothing changed 4 ) Tried with a different cable/ and still does not work. So, last thing I did was plug in the external RESET button -red wire to AREF, and the GND of RESET button to Arduino's GND. The Arduino still remembers the last sketch I uploaded, the onboard LEDs blink and so on. Just that the serial port component on the board is hosed ! How to recover. Just to state - I bought 2 such Arduinos at the same time and the other one works still fine. Must be some hardware device on the board got knocked or something ! Appreciate if you could help with some inputs.
@RalphBacon
@RalphBacon 4 жыл бұрын
Hmm. Shorting the AREF to GND is probably not a great idea but I'm not sure whether that would stop the serial port working. You can still upload sketches to your "broken" Arduino Uno by using your good Arduino as a programmer. Steps: 1. Good Arduino: load the Files > Examples > ArduinoISP > ArduinoISP sketch 2. Plug the 6-pin ICSP cable into the Good Arduino and Broken Arduino You can use Dupont cables if you do not have the 6-pin cable. 3. Upload the sketch from the Arduino IDE by selecting Tools > Programmer > Arduino as ISP (note the spaces between words) 4. Press Sketch > Upload Using Programmer The sketch is sent via your good Arduino to the broken Arduino and will upload. It will overwrite the bootloader there but that's not an issue as you can't use it anyway. If you upload a sketch that sends a simple Serial.println("Hello") you can see whether the broken Arduino can send out messages via the USB. Let me know!
@RalphBacon
@RalphBacon 4 жыл бұрын
No, no! The first (good) Arduino is used to get the "Arduino as ISP" sketch. Then upload a different sketch of your choice to the other (bad) Arduino. It uses the first Arduino as a programmer. You must be sure to choose Sketch > Upload using Programmer or you will load your sketch onto the first (good) Arduino!
@kiranshashiny
@kiranshashiny 4 жыл бұрын
@@RalphBacon I think I messed it up. i'm getting a ketch uses 4402 bytes (13%) of program storage space. Maximum is 32256 bytes. Global variables use 482 bytes (23%) of dynamic memory, leaving 1566 bytes for local variables. Maximum is 2048 bytes. avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xe0 avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xe0 avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0xe0 avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00 avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xe0 avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xe0 avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xe0 avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00 avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xe0 Problem uploading to board. See www.arduino.cc/en/Guide/Troubleshooting#upload for suggestketch uses 4402 bytes (13%) of program storage space. Maximum is 32256 bytes. Global variables use 482 bytes (23%) of dynamic memory, leaving 1566 bytes for local variables. Maximum is 2048 bytes. avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xe0 avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xe0 avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0xe0 avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00 avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xe0 avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xe0 avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xe0 avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00 avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xe0 Problem uploading to board. See www.arduino.cc/en/Guide/Troubleshooting#upload for suggest
@kiranshashiny
@kiranshashiny 4 жыл бұрын
@@RalphBacon At this time, I see that the on-board Leds blink on both the Good and the Bad one. If I remove the cable, then I upload the "Arduino as ISP" sketch to the good one successfully. The problem starts once I connect the cables to the second/bad one and then upload a new program. I get the 'out of sync' messages.
@kiranshashiny
@kiranshashiny 4 жыл бұрын
@@RalphBacon If I disconnect the bad Arduino - I can upload any code to good arduino - so far so good. So I guess something that I did to the bad arduino is making this outof sync error.
@milxl
@milxl 3 жыл бұрын
You are the man ! thanks a lot
@RalphBacon
@RalphBacon 3 жыл бұрын
Glad it helped!
@minhajisminhaj
@minhajisminhaj Жыл бұрын
Sending thanks from India 🙃🙃
@RalphBacon
@RalphBacon Жыл бұрын
Gratefully received in the UK!
@eriklaken1025
@eriklaken1025 6 жыл бұрын
All I need to know, Thank You so much.:)
@RalphBacon
@RalphBacon 6 жыл бұрын
Probably more than you need to know, Erik! Thanks for the feedback, nice to hear from you.
@aspectcarl
@aspectcarl 7 жыл бұрын
good tutorial - method 3 aka petting the watchdog :)
@RalphBacon
@RalphBacon 7 жыл бұрын
I like that alternative name, Carl, for the watchdog function. Which does work well, but forget to "pet" it at your peril as you see your Arduino board suddenly reset itself! I'm glad you like the video too.
@QG1996
@QG1996 8 жыл бұрын
i think that your last one shoulden't work properly! i made a project with an arduino due and i had external power on Vin pin. Also put a ON-OFF switch in series so i can power it on or off with this. I had 1 lcd and 1 7 segment and when i was powering on my arduino sometimes (not everytime, but most of the times) the lcd dident show something and my 7 segment outputs were set to low for every led, even though in my programm number 8 (which is all the leds on) should not exist, because i used it for numbers 1-4. So the only way to reset it was with an external reset tactile switch. ( i dident think about doing it with the programm and i prefered the external reset button). So i think that this is not working, probably because the internal counters of the arduino do not reset when power is off but i am not sure. sorry for my bad english :P!
@RalphBacon
@RalphBacon 8 жыл бұрын
You mean the method using a relay, QG? It should work exactly the same as your on-off switch. Perhaps it needs to switch off for a bit longer to give your peripherals a chance to discharge and stored voltage properly? Or, in your code, let the Arduino switch on-off your peripherals via the relay. Or it might be the sudden current demands of your LEDs and LCD that is proving too much. You can test this theory really easily by disconnecting your displays from the Arduino, switching on the Arduino, let it settle for a few seconds *then* reconnect the displays. What happens then? Remember that the LCD and the 7-segments are usually controlled by their own microcontroller so need to be properly initialised too. Just a suggestion! Thanks for raising this, I shall think further about it.
@QG1996
@QG1996 8 жыл бұрын
first of all thnx for the instant reply! yeah i mean with the way with the relay. i kept it off about an hour but still did this think.. everything was powered via the 5 and 3.3 regulated volts of the arduino so when the arduino due was powered on everything should be powered on and when its off everything should be off i am aware of the microcontroler that is on the lcd and this may cause the problem even though i am not sure... but for the 7 segment the controler was the arduino due that was conected to 7 mosfets driving all the leds (exept the dot led that i dident need it) so the segment should work fine if arduino due was reset after power on! P.S. i see you have a lot of good vids so you just got a new sub ;D keep up
@RalphBacon
@RalphBacon 8 жыл бұрын
Well thanks for subbing, that greatly appreciated. I can't think what your problem is, though, regarding the reset as you seem already aware of the way it should work. You're not overloading the 3v3 supply (it only delivers 50mA or so unless your Arduino has an onboard regulator)? Sometimes it's impossible to get to the bottom of some problems. But thanks for the kind words, drop by again soon.
@QG1996
@QG1996 8 жыл бұрын
i think i do but i dident have time to thinik about this :P and as long as it worked i was ok for now... yeah there is a voltage regulator on every arduino board but i think i overloaded :P allthough this not seem to be the problem with the reset, but i solve it with the external one! if you want you can check what i mean with your equipment and if you find something usefull you may consider making a video :D
@bob-ny6kn
@bob-ny6kn 2 жыл бұрын
"... teaching grandmothers to suck eggs..." So much has been lost in crossing the Atlantic Ocean.
@RalphBacon
@RalphBacon 2 жыл бұрын
I'm not sure grannies ever did suck eggs but it sounds pretty gross anyway!
@pacovasda5955
@pacovasda5955 7 жыл бұрын
I can't upload anything to my Arduino it's not recognized it's dead I need to reset it meaning whatever I do cannot involve a computer I need to reset it so I can hook it to a computer. Remake the example but use an Arduino that's not working and needs to be reset
@RalphBacon
@RalphBacon 7 жыл бұрын
I can't make a new video Paco, but we can think about what has gone wrong. Regardless of whether this a genuine Arduino Uno or a clone (the genuine product uses a separate ATmega16U2 µcontroller for the USB-to-Serial interface whereas a clone will probably use a CH340G chip) it is likely that it is this part that has failed, if, when you plug it into a Windows PC, it does not appear in the list of USB devices. You can still program it using a separate (very cheap) USB-to-Serial converter; the wires from the converter go to the ICSP header pins and the other end plugs into your computer's USB socket as normal. Here's a link that might help you: core-electronics.com.au/tutorials/programming-with-usb-serial-converters.html
@bernienufc3166
@bernienufc3166 5 жыл бұрын
genius, thank you, my problem solved now to watch your other vids, thanks
@RalphBacon
@RalphBacon 5 жыл бұрын
Thanks for your post, Bernie NUFC, glad it worked out, good to hear from you.
@HidekiKotegawa
@HidekiKotegawa 5 жыл бұрын
you just saved my ass
@RalphBacon
@RalphBacon 5 жыл бұрын
Glad to hear it, thanks for letting me know! And thanks for posting.
@aspectcarl
@aspectcarl 7 жыл бұрын
sounds like you're own watchdog needs petting :)
@RalphBacon
@RalphBacon 7 жыл бұрын
Ah yes, as I said in my previous post, you must not forget that watchdog if you have implemented it. Nor forget that Benny is watching me all the time and keeps me on the straight and narrow. (He might *appear* to be having a snooze on the shelf behind me but he's listening to every word). Really he is.
@kiyashko86
@kiyashko86 2 жыл бұрын
Use "optical relay" or MOSFETs for this, not "mechanical". They 100 times smaller, much more energy efficient, lasting longer/infinitely, and do the same. Mechanical relay is too stone-age technology with a lot of flaws. And have to be used in rare specific cases.
@RalphBacon
@RalphBacon 2 жыл бұрын
Hmm, it's funny you should say that but when I designed my Smart Workshop Heater Controller I explored SSR and did a video on it (video #225 kzbin.info/www/bejne/bKHZkKuod7J9abM plus a couple of others) but use a mechanical relay.
@kiyashko86
@kiyashko86 2 жыл бұрын
​@@RalphBacon Don't confused relay and sensor. I see only sensor in #225. I don't want to argue (I gave a better practical solution) - but you can use whatever you wish. Mechanical relay can be used with some high-power consumption devices, or by people who don't wanna dive in electronics.
@smarttaurian30
@smarttaurian30 5 жыл бұрын
uselessly long, thank you
@RalphBacon
@RalphBacon 5 жыл бұрын
Thank you for your feedback, ABC, noted!
@rafaelangleslopez9152
@rafaelangleslopez9152 4 жыл бұрын
Uselessly short comment :D
@thoughtful_Liona
@thoughtful_Liona 2 жыл бұрын
how can i reboot the arduino uno using code? and is reset and reboot the same?
@RalphBacon
@RalphBacon 2 жыл бұрын
No, not the same. A reset will reboot the Arduino but everything else stays powered and possibly in the incorrect state. Use an external watchdog to repower everything (see my list of videos to see how to do this very easily). Videos #190 and #194.
#23 LCD BIG DIGITS for your Arduino using I2C - Easy!
20:57
Ralph S Bacon
Рет қаралды 27 М.
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН
Scammers PANIC After I Hack Their Live CCTV Cameras!
23:20
NanoBaiter
Рет қаралды 26 МЛН
Fun with Transistors
24:33
HackMakeMod
Рет қаралды 776 М.
Level Up Your Arduino Code: External Interrupts
18:55
SparkFun Electronics
Рет қаралды 175 М.
The BEST Mechanical Display You've EVER Seen!!!
13:51
Tin Foil Hat
Рет қаралды 580 М.
From Idea to Schematic to PCB - How to do it easily!
11:05
GreatScott!
Рет қаралды 1,8 МЛН
Визитка программиста
19:40
Александр Красников
Рет қаралды 238 М.
Level Up Your Arduino Code: Timer Interrupts
17:22
SparkFun Electronics
Рет қаралды 231 М.
How does a Mouse know when you move it?  ||  How Does a Computer Mouse Work?
12:04
Arduino Uno Gets Its BIGGEST Upgrade In 12 Years
11:49
Electronoobs
Рет қаралды 88 М.
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН