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).
The UART hardware part will send and receive while you debug. However, the isr will of course not fire when you have stopped the execution of your program. So if the code hits a breakpoint, the UART will drop characters as long as the program execution is halted.
Having the debugger attached (in debugWire mode) does not reduce the performance of the microcontroller.
Best Answer
I recently installed Atmel Studio 6 and upgraded a project that had to be manualy recreated so I thought I'd document the process including use of an AVR Dragon. The first step was to create a new project and as my code was C++ I selected
GCC C++ Executable Project
:The next step is device selection, a search facility is provided that saves sifting through the entire list of devices:
The next step required for most projects is to define the CPU frequency. I went into
Project | Properties
and went to the symbols tab for the compiler I'm using, in this case C++. There I defined F_CPU by pressing the add button and typingF_CPU=11059200
to suit the crysyal I'm using. Once done the screen looks as follows (note that I corrected the value after taking the screenshot, it was missing a zero):In the same area you can go down to the tool tab and define the type of debugger / programmer and the interface. In my case I was using the JTAG interface, different options will appear if using ISP but the defaults are normally OK.
Once that's been saved you can click on the device programming icon on the toolbar or press
Ctrl + Shift + P
to get to the device programming screen.Once you've confirmed the correct tool, device and interface is selected you can press the apply button to connect. It's likely the AVR Dragon will require a firmware update to work so press the upgrade button if prompted to do so and wait for the upgrade to complete.
Once connected you'll be able to read the device signature and target voltage to confirm the connection to the target is OK. You can also program the various memories, lockbits and lock bits from the same screen.
However once your configuration bits are have been set you may find it more convenient to use the start without debugging button on the toolbar to launch the project. That will automatically build the project if required, program the device and start the program.