My next step would be to install the electrolytic capacitors as recommended in the Schematic Checklist you mentioned.
If it still doesn't work,
I would go ahead and install all the inductors, etc. recommended in the checklist --
maybe there is a reason Atmel published that checklist :-).
If it still doesn't work, I would fall back on the sorts of errors I often make:
- When I probe the VCC and AVCC power pins with a multimeter, does each and every one of them show I have the correct 3.3 V?
- Is each and every one of the GND pins solidly connected to GND?
- Did I maybe install the PDI connector backwards or upside down again ? Or maybe forget to connect one of its pins to the MCU? (Use a multimeter to beep out the connection, one probe directly on the MCU chip pin, the other at the far end of the cable to the part of the programmer that pin is supposed to be connected to)
- Have I used the multimeter beeper to confirm that I haven't shorted any two adjacent pins?
- Is there maybe something wrong with the Dragon programmer or the cable between it and the board? Does the Dragon program work right when I use it to program some other similar AVR chip, perhaps a through-hole chip crammed into a solderless breadboard?
Could you post a photo of your PCB?
With most digital electronics, even if the PCB is known to be incorrect, it's usually quicker and easier to cut traces and add jumper wires on the prototype until you at least get to the "blink an LED" stage than to wait for another PCB to be fabbed that has fewer problems with it.
10 mm extra trace length is irrelevant in this application. I'm almost certain that is not the problem.
After I've exhaustively made sure that everything is connected properly, as recommended by the manufacturer, and there's no shorts between adjacent traces, and the program still doesn't "recognize" the chip, only then would I conclude the chip is a dud and get a replacement chip.
Later, after you get the programmer to "recognize" the chip and start to program it, then you can think about:
Is there a pin that will toggle to show me it's OK? Kind of a hardware "Hello World"?
Yes.
Blinking an LED is considered the equivalent of "Hello World" in electronics. a b c d
This doesn't happen automatically, though -- you need to connect a pin to an LED and you need to write some code to blink it.
Even after a person programs the other pins to do useful things,
they often leave the code in to blink a "heartbeat" LED a b that once a second or so.
That makes it pretty much instant to confirm that the program is loaded and running,
the right frequency of crystal is connected,
etc.
(Some people deliberately change the blink rate every time they reprogram the chip, just to reassure themselves that the chip is now running with the latest code rather than the old code).
You can still use it as /RESET
. See this application note from Equinox for some details, or Atmel's own application note describing the PDI interface, if you'd prefer to get it straight from the source.
See part 3.2 in the Atmel doc for more specifics on how it works. In order to enter PDI mode, the programmer does a little dance: first it holds the PDI_DATA line high for a little while, which disables the normal reset functionality. Then, 16 edges are sent on PDI_CLK (RESET). If there aren't 16 edges, or if the timing isn't right, then it's treated as a normal reset. This is how the microcontroller differentiates between trying to enter programming mode and a normal reset.
It's common to put some filter circuitry on /RESET, or even to have a watchdog chip controlling it instead. That would cause problems with PDI -- as they describe, you need to have /RESET be more or less disconnected from anything else while programming for the programming to work. If you just have a button and maybe some small capacitance on /RESET, you shouldn't have to worry about it. But if you need more circuitry connected there, you may want a jumper or switch that you can use to temporarily disconnect things for programming.
Best Answer
The PDI functionality of the pin is still active on an XMEGA even if the
RESET
functionality is disabled via theRSTDISBL
fuse. You can program the chip using a normal PDI connection.How does it do this? There is a dance between the PDI clock and data pins that puts the chip into programming mode without needed an external reset. From the datasheets: