Electrical – Atmega128 ISP programming, unable to read device ID

atmegaavrerror

I am trying to program a Atmega128.
ISP programming
First I used AVR dragon, I can read the target voltage, but when I go to read the device signature, warning comes

Unable to enter programming mode.


Please verify device selection, interface settings, target power and connections to the target device.

I am using AVR studio 6.
I have programmed other Atmega128 with the same AVR dragon, but still I tried to program by using STK500. Its of no use as I got the same warning.

I have searched in google, but I did not find any solution.
sCK, RESET, MOSI, MISO, VCC, Ground all connections are perfect and I have put bypass capacitors between Vcc and ground of Atmega128.

Even I replaced the IC with new Atmega128, but the result is same.

Best Answer

My usual steps to recover from ISP issues:

  1. Check power. The Dragon won't supply power over the Vcc line. The target needs to be powered by its own supply. The Vcc line is just for measuring target voltage. Also make sure you are in the right part of the power voltage vs intended operating frequency graph (or you'll find out you can't do 16 MHz at 3.3V).

  2. Make sure you have the right SPI pins connected. On a few AVR chips, they have an Alternate SPI port. ISP will always use the alternate, if it exists, but it is not common (but this bit me recently on the ATmega32M1).

  3. Make sure Studio talks to the Dragon (note they are on version 7 now). If it is able to get the target voltage, then it's probably fine.

  4. Turn down the clock speed (as per @Rev1.0). If that works, you can try bringing it back up and see about what you can get out of it.

  5. Try to access the fuses. If you can get that far, make your adjustments in the fuses and you are probably good to go.

  6. Check the SPI and see if anything on the board might be colliding on the bus. Do you have another chip on the bus that likes to talk when it shouldn't?

  7. If that fails, get the o-scope out and check for signals present on Reset, MOSI, MISO and SCK, and debug from there.

I've had to get this working several times before, but it was never because of a bad AVR or bad Dragon (although maybe I'm lucky). Usually something will get them talking, eventually.