Author Topic: ATMega328P and AVR Dragon (ISP) Not working  (Read 3826 times)

0 Members and 1 Guest are viewing this topic.

Offline danergoTopic starter

  • Regular Contributor
  • *
  • Posts: 111
  • Country: hu
ATMega328P and AVR Dragon (ISP) Not working
« on: March 23, 2017, 09:14:50 pm »
Hello, Guys,

I just built a PCB with M328P, and I'm trying to program it with my AVR Dragon via ISP.
Dragon is working for sure, it's after burning dozens of chips before.

And the M328P should also be fine, I just opened its case (from tape).
DC is 5V (4.81), no shorts, no heating happens.

I have an XTAL soldered onto the board.

When trying to connect to the chip with AVR Dragon (avrdude), I got an error:
Code: [Select]
sudo avrdude -cdragon_isp -pm328 -t
avrdude: jtagmkII_setparm(): bad response to set parameter command: RSP_FAILED
avrdude: jtagmkII_getsync(): ISP activation failed, trying debugWire
avrdude: jtagmkII_setparm(): bad response to set parameter command: RSP_DEBUGWIRE_SYNC_FAILED
avrdude: failed to sync with the AVR Dragon in ISP mode

avrdude done.  Thank you.

Is M328P special somehow?
Thanks very much!
 

Online alm

  • Super Contributor
  • ***
  • Posts: 2880
  • Country: 00
Re: ATMega328P and AVR Dragon (ISP) Not working
« Reply #1 on: March 23, 2017, 10:53:02 pm »
Are all ISP lines connected correctly? Pull-up resistor on /RST not too low? Power supply connected and decoupled? ISP frequency not too high for the clock? I believe out of the box the 328 is set for the internal 1 MHz oscillator, so ISP frequency should be below 64 kHz.

If you already changed some fuses, it is possible that the clock fuses are wrong or RSTDISBL/SPIEN were set, all of which could prevent ISP from working.

For more ideas check AVR042.

Offline danergoTopic starter

  • Regular Contributor
  • *
  • Posts: 111
  • Country: hu
Re: ATMega328P and AVR Dragon (ISP) Not working
« Reply #2 on: March 24, 2017, 06:02:06 am »
Thanks for the tips.

This is my schematic: .
Of course, there are other peripherials on the chip too, but they are not yet soldered in.

I've tried with avrdude -B 32, which should be the lowest frequency, but it resulted the same.
Now looking on the AVR042. In the meantime, if you have any ideas based on my sch, it's more than welcome. :)

Thanks!
 

Offline danergoTopic starter

  • Regular Contributor
  • *
  • Posts: 111
  • Country: hu
Re: ATMega328P and AVR Dragon (ISP) Not working
« Reply #3 on: March 24, 2017, 08:17:05 am »
Is it a problem with this 328p if the xtal is applied before setting the fuses?

Other MCUs dont care if xtal is installed before programming for the first time.

Is ISP for 328P using the same pins as usual? (MISO, MOSI, SCK, RST)?
(m128a used rx and tx for io)

5V is getting into the MCU.
It is not hot at all, so by sensing, everything is ok.
Pin1 is well marked on this, and I'm using the TQFP32 version, which is pretty easy to solder, but I double checked it again.

MISO, MOSI, SCK and RSTN are going to the header, then via cable to the dragon.
All the wires are all right (measured by multimeter from dragon to my board).

Is there anything else beside having a faulty m328p soldered in?

Thanks :)
 

Online alm

  • Super Contributor
  • ***
  • Posts: 2880
  • Country: 00
Re: ATMega328P and AVR Dragon (ISP) Not working
« Reply #4 on: March 24, 2017, 11:53:32 am »
ISP to MISO/MOSI/SCK/RST is correct. I assume ground and +5V are also connected to the header (shown on the schematic, but for troubleshooting you sometimes have to ask the stupid questions)?

With default fuse settings the crystal should not matter, since it is using the internal 8 MHz RC oscillator with /8 divider. Just to be sure, you did not succeed one time in programming and somehow changed the fuses? Is the ATmega328p blank or was it loaded with an Arduino bootloader or something else that might have changed its fuse settings?

The other things I can think off is apart from verifying all connections are:
- Test ISP from the Dragon to some other, known-working, target. The old version (pre-2009 or so) without mounting holes was quite fragile and used to kill its DC-DC converter if you looked at it funny. The new version was much better, but it is still not the most robust tool without any case.
- Test for shorts between any of the pins you connect (e.g. MOSI/MISO/SCK/RST/VCC/GND).
- Try removing the crystal and feed a 1 MHz clock to XTAL1 (the Dragon may have an output, or generate it with another AVR with CLKOUT or a function generator). This should recover from most incorrect fuse settings.
- Wire the AVR up for high-voltage parallel programming. This will require you to remove most components from this PCB and connect about two dozen wires between the Dragon and this board. Note that this uses high voltage (12 V) signals, so be sure to remove things like voltage regulators. This should work regardless of the fuse settings. Soldering in another AVR would be quicker, however.


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf