My new standalone AtMega PCB is finished. Everything works as breadboarded except in-circuit programming of the 328P using FTDI. On the breadboard all worked fine however the identical circuit on the PCB does not. (I get the AVR Dude 'programmer out of sync' message).
I've checked everything on the board. Nothing is different from the breadboard except the distance of some components from the MCU. The 10K pull-up resistor, diode and .1uF cap on pin 1 are not as close to the MCU as they are on the breadboard. I'm concerned that the slight capacitance of the trace is defeating the trigger pulse. Is it critical to have the DTR cap close to pin one?
How far is "not close"? In the early days of auto-reset, some of the derivative boards were adding the capability by stretching a cap from their FTDI input pins to the chip's RESET, so it's not critical...
In-circuit serial programming (ICSP/ISP) is done through a 6-pin ISP header, not the FTDI header. FTDI is for serial programming through the bootloader.
layout doesn't matter for the DTR-reset thing for any layout that's vaguely sane. The common cases where it matters are decoupling caps and lines to and from crystal.
Have you remembered to bootload the chip? Programming over serial (ie, ftdi ) needs the bootloader (which must be programmed by ISP via 'burn bootloader' or manually with avrdude)
OK serial programming the chip using a 5V FTDI cable. Yes the chip has a bootloader on it. On the breadbaord circuit (identical) I can upload a sketch no problem. The same chip on the PCB however and its a no go. I've thought it might be the crystal but that came right out of a working breadboard as well so its unlikely. The sketch also functions fine on the board which also includes an i2c keypad so it's not the chip.
For ergonomics I placed the FTDI header about 8 inches (trace length) from the MCU. This means the RXD and TXD trace lengths are about 8 inches as well. They have to follow the board edge. The reset cap is about 4 trace inches from the pin. I haven't found out whats causing the upload issue and it occured to me that part placement might be the cause. I'm reaching here.
On the breadboard I have the FTDI header and reset cap very close to the MCU.
I think that should be fine - I don't have issues with 8" wires for programming over serial (ftdi)
Have you doublechecked that it actually is the same as the breadboard circuit? Like, with multimeter in continuity mode, making sure everything related to the ftdi header is the same? Is the diode the right way around?
I always do continuity checks on every trace and pad after etching. I'll check again when I get home from my business trip but I'm sure the diode is in correctly. I was very careful to get the FTDI header in correctly. When I get back I'll be replacing the reset cap.
There are no inadvertent components to ground. (Everything was produced using Eagle). didn't think the trace lengths would have much impact but I came here to get some opinions.
Thanks for the input guys. I'll keep you posted when I get back to it.
Don't know if this will help you out, CopperDog, but when I built my Arduino wire-wrap controller, I had to use a 1.0 uF cap for the RESET cap. The 0.1 uF cap was just too erratic !! Also, I am using an FT-232 module from DigiKey which has all of the necessary pins including two pins for the Tx and Rx LED's.
I don't think trace length would be an issue for these types of slow signals.
I use a real FTDI cable and in that cable the FTDI chip is inside the USB connector and the actual cable is just wires.
My cable is 36 inches long and there are no issues with auto reset or serial communications.
Since it sounds like the board works with a pre burned AVR chip,
one easy test would be to try to "autoreset" the device by hand.
I.e. ground the autoreset pin and see if the AVR resets and then starts up.
Sorry for the delay but the board had to go out like it was. I put the chip in a Uno for a temp upload until I could get to it.
I found the problem. It was the tiniest of solder bridges that I just kept missing on my visual inspections. May have come from a sliver of solder material when I trimmed all the leads on the board. Melted when I went back and touched up some solder points?