ATmega board not connecting to accept sketch

Hi All

I read extensively to find a solution for my Mini Rambo Atmega2560 chip based board to accept sketches.I will endevour to furnish all the details for your kind assistance.

My ATmega2560 shows the com port when connected by USB. It behaves like it has no firmware or bootloader as says "timeou" for every attempt at uploading a sketch via USB connection. So I tried the following as documented here to ensure I followed the steps properly.

I used an Arduino diecimila to create a programmer as follows:

  1. Opened the ArduinoISP sketch and uploaded it to the Arduino Diecimilia using the correct virtual serial port and board type and chip ATMega168. It ran successfully and loaded the sketch

  2. I created the ICSP connector for the MiniRambo and the Arduino inclusive of the ICSP Reset pin(programmer) to D10 (target) pin

  3. I connected the ICSP cable to the two boards and powered the Arduino via power adapter and usb connection to the Windows PC (win7). Both require independent power to ensure proper operating voltage applied unless I am incorrect

  4. I confiured Arduino IDE to set the programmer to Arduino as ISP and the target board as Arduino ATMega 2560

Now I tried multiple scenarios after and I have a few questions for clarification so I can try a more logical informed approach.

Do I need to connect both boards with USB as well as independent power?

Which serial port# do I use in Arduino IDE if both boards are connected via USB leading up to the next step?

Do I need to open Nick Gammon programmer sketch into Arduino IDE and select "upload using programmer" or "Burn Bootloader" with that sketch open using the programmer and targertas in step 4). Or do I upload to Arduino Diecimal (Both approaches timeout or say out of sync)

"Upload Nick Gammon Programmer" to Arduino programmer or "Upload using Programmer with Nick Gammone Programmer" to Target Atmega2560?

After that the last step is to Burn Bootloader?

Arduino Diecimil capable of performing the role as a programmer?

markos2a:
Do I need to connect both boards with USB as well as independent power?

No. Just connect the Diecimila to your computer with the USB cable and that will power both the Diecimila and the Rambo board.

markos2a:
Which serial port# do I use in Arduino IDE if both boards are connected via USB leading up to the next step?

Use the serial port of the Diecimila.

markos2a:
Do I need to open Nick Gammon programmer sketch into Arduino IDE and select "upload using programmer" or "Burn Bootloader" with that sketch open using the programmer and targertas in step 4). Or do I upload to Arduino Diecimal (Both approaches timeout or say out of sync)

"Upload Nick Gammon Programmer" to Arduino programmer or "Upload using Programmer with Nick Gammone Programmer" to Target Atmega2560?

Forget about the Nick Gammon stuff. That doesn't apply. It seems like you're getting two separate tutorials jumbled together. You can use the ArduinoISP sketch to turn your Diecimila into an Arduino as ISP programmer or you can use the Nick Gammon hex uploader sketch. It makes absolutely no sense to try to do both. I recommend the Arduino as ISP approach because it's much more standardized and powerful. With Arduino as ISP, you can upload any bootloader to any AVR chip. With the Nick Gammon thing you can only upload a small selection of bootloaders to a small selection of AVR chips. Either would probably work in this case, but the experience you gain using the Arduino as ISP will be much more valuable to you for later projects.

You need to upload File > Examples > 11.ArduinoISP > ArduinoISP to the Diecimila. That's all.

markos2a:
After that the last step is to Burn Bootloader?

Yes.

markos2a:
Arduino Diecimil capable of performing the role as a programmer?

Yes. You might need to connect a 10 uF capacitor between the reset and ground pins on the Diecimila.

Great I was thinking I might have been complicating things using both methods. Using the AndroidISP by itself is cool. Thanks to your reply I will hopefully find success.

So to summarise after The the Android programmer is created using AndroidISP , Programmer set to Android as ISP and the target set and one USB connected to the Programmer all I need to do is run Burn Bootloader (For reinstating a bootloader on the Atmega2560). It still times out or outof sync so I think that capacitor is needed I will hope I have one handy and get back to post an update.

Cheers

Fantastic the Capacitor was the issue of the bootloader not executing properly.

Now I tried to load firmware via USB on the Atmega2560 and it is still timing out. What can I try to resolve this? any thoughts most welcomes

Please do this:

  • (In the Arduino IDE) File > Preferences
  • Uncheck the checkbox next to "Show verbose output during: compilation"
  • Check the checkbox next to "Show verbose output during: upload
  • Click "OK"
  • Sketch > Upload
  • After the upload fails, you'll see a button on the right side of the orange bar "Copy error messages" (or the icon that looks like two pieces of paper at the top right corner of the black console window in the Arduino Web Editor). Click that button.
  • In a forum reply here, click on the reply field.
  • Click the </> button on the forum toolbar. This will add the forum's code tags markup to your reply.
  • Press "Ctrl + V". This will paste the upload output between the code tags.
  • Move the cursor outside of the code tags before you add any additional text to your reply.
Arduino: 1.8.9 (Windows 7), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

Sketch uses 156314 bytes (61%) of program storage space. Maximum is 253952 bytes.
Global variables use 5227 bytes (63%) of dynamic memory, leaving 2965 bytes for local variables. Maximum is 8192 bytes.
C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega2560 -cwiring -PCOM5 -b115200 -D -Uflash:w:C:\Users\MARKOS~1\AppData\Local\Temp\arduino_build_445495/Marlin.ino.hex:i 

avrdude: Version 6.3-20171130
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM5
         Using Programmer              : wiring
         Overriding Baud Rate          : 115200
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer

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.

It is behaving as though the usb to serial component needs to be reinstalled or flashed or something.

This would be nice to fix to get my USB to serial up again for future flashing updates most easily.

On the lighter side I used the my custom programmer to upload this sketch that keeps failing via USB using the ISP communication and it worked nicely. I will test it to make sure all is well but this is Progress! Darn capacitor lost me 1 full day of tinkering

Ive been reading about DFU is this a possible solution if at all?

I did notice after the Bootloader was installed the orange led was blinking is that the window to mess with the DFU for which I know absolutely nothing and I'me anxious to hear what is the procedure as this is most educational and productive.

Cheers for helping me overcome that capacitor drama for which I knew of but some articles said was optional and didnt want to make a brick out of the atmega2560

markos2a:
I used the my custom programmer to upload this sketch that keeps failing via USB using the ISP communication

When you do that you erase the bootloader, which causes the error you got when you try a normal upload over the Rambo's USB cable.

I tried the Upload using programmer when the USB sketch upload failed via USB

Ok Great news.

The board 32u2 Serial was corrupted or erased when I got it. I used the firmware for the that chip "RAMBo-usbserial-DFU-combined-32u2.HEX" and loaded it manually using avrdude with the following syntax:

avrdude -CC:\Serial/avrdude.conf -v -patmega32u2 -carduino -PCOM21 -b19200 -D -Uefuse:w:0xF4:m -Uhfuse:w:0xD9:m -Ulfuse:w:0xEF:m -Uflash:w:C:\Serial/RAMBo-usbserial-DFU-combined-32u2.HEX:i -Ulock:w:0x0F:m

You can use the firmware for the 16u2 (Arduino-COMBINED-dfu-usbserial-atmega16u2-Mega2560-Rev3.hex) as needed and should work same I would think. I used the same ISP programmer I made from the Arduino board and 3x2 cable connector on the ICSP-1 pins near the USB port (This is separate from the other ICSP pins for the Atmega chip of course, No led lights as did with the ATmeg2560 ICSP but it worked).

Now I can flash the Atmega board via USB with no issues

Great work! I'm so glad to hear you found the solution. Thanks for taking the time to post an update.