Go Down

Topic: Arduino Robot: How I do hard reset or burn bootloader of AR Control (Read 4668 times) previous topic - next topic

gustavorps

I followed this topic to resolve Arduino Robot upload problem but did step 9 with one Arduino connected to the PC and the Arduino Robot, now the Arduino Robot is not identified as COM port, the screen is and reset button does not work.

How can I do a hard reset or burn bootloader Arduino Robot Control?

johnwasser

It should be as easy as:

Install Arduino 1.6.x

ISP Arduino: Arduino UNO
Target board: Arduino Robot Control Board 

Connect the USB cable to the PC and ISP Arduino

Install the ArduinoISP sketch in the ISP Arduino.
File->Examples->ArduinoISP
Tools->Board->Arduino UNO
Tools->Port->(serial port for ISP Arduino)
File->Upload

Go to Preferences... and check the box for "Show verbose output during: [  ] compilation [X] upload"

Install the ICSP wiring:



Attempt to burn bootloader without disabling auto-reset on ISP Ardiuino. 
Tools->Board->Arduino Robot Control
Tools->Port->(serial port for ISP Arduino)
Tools->Programmer->Arduino as ISP
Tools->Burn Bootloader.

Reading | Error while burning bootloader.
################################################## | 100% 0.05s

avrdude: Device signature = 0x1e960f
avrdude: Expected signature for ATmega32u4 is 1E xx xx
         Double check chip, or use -F to override this check.




This means that the ISP Arduino got reset when communications was established over USB.  The bootloader burning program ends up talking to the Arduino UNO bootloader WHICH USES THE SAME PROTOCOL AS ArduinoISP!  The process gets as far as checking the chip signature and finds it is talking to an ATmega328P (the UNO) when it was told to expect an ATmega32u4 (the Robot Control board).

Note: If the target board has the same type of processor as the ISP Arduino has, the signature check would have passed and an error would occur further into the process. Here is what happens if the target board has an ATmega328P but the UNO resets:
avrdude: Device signature = 0x1e960f
avrdude: erasing chip
avrdude: reading input file "0x3F"
avrdude: writing lock (1 bytes):

Writing |  ***failed;  
################################################## | 100% 0.13s

avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x3F:
avrdude: load data lock data from input file 0x3F:
avrdude: input file 0x3F contains 1 bytes
avrdude: reading on-chip lock data:

Error while burning bootloader.
Reading | ################################################## | 100% 0.02s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
         0x00 != 0x3f
avrdude: verification error; content mismatch



Add a 10 uF capacitor to the ISP Arduino with the positive side of the capacitor going to Reset and the negative side of the capacitor going to Ground.  This absorbs the Reset pulse and keeps the ISP Arduino from resetting.

Now re-attempt to burn a bootloader.  If the target board has the proper clock crystal then this should be successful.  If the chip expects a crystal and doesn't have one it will fail like this:

Tools->Burn Bootloader.

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check..



This is a symptom of the target chip's clock not running.  An ATmega that is expecting a crystal won't accept serial programming without a crystal or ceramic resonator between pins 9 and 10, or an external clock injected into pin 9.  If you can find a crystal between 8 and 20 MHz you should connect it between pins 9 and 10 of the target chip.  If you can't find a spare crystal or you try the crystal and still get the "Device signature = 0x000000" error you should get this modified ArduinoISP sketch from adafruit: https://github.com/adafruit/ArduinoISP  Go back to the start of this document and upload this version of ArduinoISP to your ISP Arcuino.  Connect Pin 9 of the ISP Arduino to pin 9 of the target ATmega328P chip (not D9).  That will provide a temporary 8 MHz clock to allow programming without a crystal.  Try Tools->Burn Bootloader again. 

If it still fails with "Device signature = 0x000000" you might have a chip with configuration fuses set to disable serial programming.  To fix the fuses you will need something like the HV Rescue Shield 2 from MightyOhm (http://mightyohm.com/blog/products/hv-rescue-shield-2-x/).  That uses High Voltage Parallel Programming to reset your ATmega328P to factory defaults.  Of course your ATmega328P may be defective and can't be recovered.

avrdude: verifying ...
avrdude: 1 bytes of lock verified

avrdude done.  Thank you.


SUCCESS!
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

gustavorps

Many thanks johnwasser!
I burn the bootloader successfully by following this method:

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check..


This is a symptom of the target chip's clock not running.  An ATmega that is expecting a crystal won't accept serial programming without a crystal or ceramic resonator between pins 9 and 10, or an external clock injected into pin 9.  If you can find a crystal between 8 and 20 MHz you should connect it between pins 9 and 10 of the target chip.  If you can't find a spare crystal or you try the crystal and still get the "Device signature = 0x000000" error you should get this modified ArduinoISP sketch from adafruit: https://github.com/adafruit/ArduinoISP  Go back to the start of this document and upload this version of ArduinoISP to your ISP Arcuino.  Connect Pin 9 of the ISP Arduino to pin 9 of the target ATmega328P chip (not D9).  That will provide a temporary 8 MHz clock to allow programming without a crystal.  Try Tools->Burn Bootloader again.
Soon your bitcoins will be in your wallet.

I also want to turn your statements in a tutorial in Portuguese for the Arduino community in Brazil.

Hugs and thanks again,

johnwasser

If you want to translate more, here is the original which covers burning an ATmage328P on a breadboard and includes notes for an ATtiny45 on a breadboard:

Burning a Bootloader
(Arduino 1.6.1 running on MacBook Pro w/ OS X 10.10.2)
ISP Arduino: Arduino Diecimila w/ATmega168 (didn't have a second ATmega328P available)
Target chip in breadboard: ATmega328P (has UNO bootloader and no crystal)

Connect the USB cable to the PC and ISP Arduino

Install the ArduinoISP sketch in the ISP Arduino.
File->Examples->ArduinoISP
Tools->Board->Arduino Duemilanove or Diecimila
Tools->Processor->ATmega168
Tools->Port->(serial port for ISP Arduino)
File->Upload


Go to Preferences... and check the box for "Show verbose output during: [  ] compilation [X] upload"

Install the breadboard wiring:

Target
Pin
Arduino
Pin
Target
Pin
Arduino
Pin
1Pin 1028
227
326
425
524
623
7+5V22GND
8GND21
9
20+5V
1019Pin 13
1118Pin 12
1217Pin 11
1316
1415


Turn on verbose upload logging in "Preferences..."

Wiring for ATtiny25/45/85:
ATtiny45UNOATtiny45UNO
1Pin 108+5V
27Pin 13
36Pin 12
4Gnd5Pin 11


Tools->Board->ATtiny45 (internal 8 MHz clock)
Tools->Port->COM7 (same as above)
Tools->Programmer->Arduino as ISP
Tools->Burn Bootloader

If that doesn't work, show use the verbose upload messages.

Attempt to burn bootloader without disabling auto-reset on ISP Ardiuino.
Tools->Board->Arduino UNO
Tools->Port->(serial port for ISP Arduino)
Tools->Programmer->Arduino as ISP
Tools->Burn Bootloader.

Reading | Error while burning bootloader.
################################################## | 100% 0.05s

avrdude: Device signature = 0x1e9406
avrdude: Expected signature for ATmega328P is 1E 95 0F
         Double check chip, or use -F to override this check.





Note: If the ISP Arduino had an ATmega328P processor this check would have passed and an error would occur further into the process. Here is what happens if I put an ATmega168 into the breadboard and try to burn a Diecimila 168 bootloader to it:
avrdude: Device signature = 0x1e9406
avrdude: erasing chip
avrdude: reading input file "0x3F"
avrdude: writing lock (1 bytes):

Writing |  ***failed;  
################################################## | 100% 0.13s

avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x3F:
avrdude: load data lock data from input file 0x3F:
avrdude: input file 0x3F contains 1 bytes
avrdude: reading on-chip lock data:

Error while burning bootloader.
Reading | ################################################## | 100% 0.02s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
         0x00 != 0x3f
avrdude: verification error; content mismatch



Added a 10 uF capacitor to the ISP Arduino with the positive side of the capacitor going to Reset and the negative side of the capacitor going to Ground.

Now attempt to burn a bootloader.  If the chip is not set to expect a crystal or external clock then this should be successful.  If the chip came with (or has had burned) an Arduino bootloader it will fail like this:

Tools->Burn Bootloader.

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check..



This is a symptom of the target chip's clock not running.  An ATmega that is expecting a crystal won't accept serial programming without a crystal or ceramic resonator between pins 9 and 10, or an external clock injected into pin 9.  If you can find a crystal between 8 and 20 MHz you should connect it between pins 9 and 10 of the target chip.  If you can't find a spare crystal or you try the crystal and still get the "Device signature = 0x000000" error you should get this modified ArduinoISP sketch from adafruit: https://github.com/adafruit/ArduinoISP  Go back to the start of this document and upload this version of ArduinoISP to your ISP Arcuino.  Connect Pin 9 of the ISP Arduino to pin 9 of the ATmega328P you are trying to program.  That will provide a temporary 8 MHz clock to allow programming without a crystal.  Try Tools->Burn Bootloader again.

If it still fails with "Device signature = 0x000000" you might have a chip with configuration fuses set to disable serial programming.  To fix the fuses you will need something like the HV Rescue Shield 2 from MightyOhm (http://mightyohm.com/blog/products/hv-rescue-shield-2-x/).  That uses High Voltage Parallel Programming to reset your ATmega328P to factory defaults.  Of course your ATmega328P may be defective and can't be recovered.

avrdude: verifying ...
avrdude: 1 bytes of lock verified

avrdude done.  Thank you.



SUCCESS!
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

Go Up