0
\$\begingroup\$

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.

\$\endgroup\$
  • 1
    \$\begingroup\$ Check that the interface speed is lower or equal to 250kHz in case the MEGA is running on the internal 1MHz RC. If the fuses were already set to use an external crystal oscillator maybe that is the problem and the oscillator is missing? \$\endgroup\$ – Rev1.0 Jun 30 '16 at 12:29
1
\$\begingroup\$

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.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ "ISP Will always use the alternate". Not true. The ATTiny841 has a alternate SPI location, but the ISP uses the default location. A better thing to say is that the pins will always be explicitly listed in the datasheet in the external serial programming section. \$\endgroup\$ – Tom Carpenter Jun 30 '16 at 16:46
  • \$\begingroup\$ Also to add to the list, feed an external clock of say 1MHz into the CLKI pin just in case the fuses are set to disable the internal oscillator. \$\endgroup\$ – Tom Carpenter Jun 30 '16 at 16:47
  • \$\begingroup\$ @Tom Carpenter True about Tiny but I haven't touched a Tiny in over 10 years. I didn't even know about the alternate port-for-ISP-on-AVR until two months ago when we fired up our first ATmega32M1 and ISP did not work. Had to flywire to get ISP shifted to the alternate port, but once we had it in debugWire we pulled up the flywires. \$\endgroup\$ – Smith Jul 1 '16 at 15:55
0
\$\begingroup\$

Thank you for the points, information.. I checked the connections and power. Everything was fine. Device ID only am unable to read, so i cant change/modify the fuse settings, also the atmega128 IC is a new IC. I have used 11.0592MHz crystal. As it was last option i tried to check the crystal signal, using oscilloscope when I checked the signal/frequency at XTAL1, XTAL2 I found that its zero/ground, no pulse/signal/frequency. I changed my crystal, even the bypass capacitors used. But its of no use. Finally I replaced this atmega128 with a already used/programmed/working Atmega128. Now I can program it on my same PCB board,with the same crystal and same avr dragon.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.