I hav an arduino nano who worked perfect but I recently got problems running and uploading a sketch.
There is no need for an electonics scheme because the problem happens (not only) when there is nothing connected.
There is also no need (I think) for progra code becaus I use the standerd example Blink program from the arduino IDE without mods.
When I start te IDE and connect the arduino nano I can upload a sketch afther this I got an error "stk500_getsync() attempt 10 of 10: not in sync: resp=0x20", this without changing a thing on hardware or software.
The first time I upload the sketch it works for a short amount of time before stopping, even the reset button on the arduino does nothing.
To re-upload a sketch I have to disconnect the arduino for a while before trying again.
I preformed the closed loop pcontrol and had no problem.
In order to gather more information that might help us to troubleshoot your problem, I'm going to ask you to post the full output from the upload when in verbose mode.
Please do this:
Select File > Preferences from the Arduino IDE's menus.
Uncheck the checkbox next to Show verbose output during: [] compilation
Check the checkbox next to Show verbose output during: [] upload.
Click the OK button.
Attempt an upload, as you did before.
After the upload fails, you'll see a button on the right side of the orange bar in the Arduino IDE: Copy error messages. Click that button. This copies the full output to the clipboard.
Open a forum reply here by clicking the Reply button.
Click the </> icon on the post composer toolbar. This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
Press Ctrl+V. This will paste the error output from the upload into the code block.
Move the cursor outside of the code tags before you add any additional text to your reply.
Arduino: 1.8.16 (Windows Store 1.8.51.0) (Windows 10), Board: "Arduino Nano, ATmega328P"
Sketch uses 924 bytes (3%) of program storage space. Maximum is 30720 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.51.0_x86__mdqgnx93n4wtt\hardware\tools\avr/bin/avrdude -CC:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.51.0_x86__mdqgnx93n4wtt\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM7 -b115200 -D -Uflash:w:C:\Users\peter\AppData\Local\Temp\arduino_build_319167/Blink.ino.hex:i
avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.51.0_x86__mdqgnx93n4wtt\hardware\tools\avr/etc/avrdude.conf"
Using Port : COM7
Using Programmer : arduino
Overriding Baud Rate : 115200
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00
avrdude done. Thank you.
An error occurred while uploading the sketch
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Does this still happen if you upload the example Blink sketch?
Are you connecting to a USB 3 port? Those sometimes give problems.
I would doubt you are using the wrong bootloader setting since you could never get the original upload if that were wrong, but check the port setting, your computer may be disconnecting the USB and reconnecting to a different port.
The issue was frequently emergent when people updated their Arduino AVR Boards version from 1.6.21 or previous. With previous versions, the "old bootloader" setting was the default, but in 1.6.22 the "ATmega328P" option became the default. So the update breaks uploads for everyone with a Nano that has the old bootloader. Since the IDE automatically offers newer boards platform versions, they might not associate the update with the breakage and they weren't kind enough to do a major version bump to communicate the breaking change to the users. Arduino traditionally has taken a marketing approach to versioning (i.e., 2.0 == "new and improved") rather than following standardized professional software development practices.
This sounds like a broken board to me. If closed loop pcontrol means the loopback test, the TTL-to-USB chip is still functioning correctly and there is a good chance that the 328P processor is faulty. wait a while could indicate overheating.
What was connected when the problems started happening? How was the board powered at that time?
There was a DHT22, HC-SR04, an IR-reciever and an WS2811 led-strip connected.
The power was extern 5V to GND pin and VIN pin.
Tis all worked properly on my breadboard, when i wanted to test on my PCB
the problems started. I tested on short circuit before I installed the arduino and powered it up.
While running the arduino does not feels hot.
The uploaded program runs for about 1 to 2 seconds before stopping.