Debugging Arduino-clone PCBs?

I've built a few boards by hand that functioned as Arduino clones: an ATMega328P, a crystal, some capacitors and a pull-up resistor, wired up as necessary on a piece of stripboard. These boards worked fine, as have equivalent breadboarded circuits. I didn't use a solder tail, just soldered the microcontroller onto the board.

Now that I am trying to develop PCBs, however, I've run into problems. Specifically, neither of the two boards I've tried to assemble so far have worked. I've tested each of the power and ground leads with a multimeter, poked at the interrupt line and TX/RX, and it all appears to be hooked up correctly, but avrdude can't get the board to respond. Nothing happens. When I plug the same USB interface into an apparently equivalent circuit on a breadboard, it works fine.

The two PCBs are not variants of each other - I started from scratch on the second board, since it's for a different project. In both cases I tested the ATMega328P in a standard Arduino beforehand and verified that I could program it, but after soldering it onto the board I get nothing.

The only things I can think of that the boards have in common are that they are both 2-layer PCBs with a filled plane on top for power and a filled plane on bottom for ground. (Yes, I've tested the planes and both have the expected voltage.) Obviously this is not true of my one-layer stripboard project or the breadboard circuit. Is it possible that this filled-plane design is causing problems? I'm a software guy, not an electrical engineer, so I'm kind of just guessing.

Have you run into problems like this? How did you figure out what had gone wrong? I am looking for debugging tips, experiences of common failures when trying to make a custom PCB with an Arduino-derived controller circuit, suggestions of things to check.

Is it possible that I've melted the microcontroller? Neither of the two stripboard projects used a solder tail and I had no trouble just soldering the chips in, but maybe I did something differently this time without realizing it. Is this a realistic concern?

One of the boards has a JTAG connector; the other one does not but I could solder wires onto the SPI and reset pins to create one. I also have a USB->JTAG interface, though I've never used it. Is there any kind of chip diagnostic I could run if I were to set this up?

Thanks for any suggestions or experiences you can offer!

cool story bro :slight_smile:

post pictures and design files

without knowing what you did .. um magic?

Is it possible that this filled-plane design is causing problems?

No, not really. It could be shorted to some important signal, i suppose...

I just soldered the microcontroller onto the board.

That makes it harder :frowning:
Do you have a pin 13 LED? Does it flash as per whatever bootloader you have installed? If so, that eliminates a lot of potential errors of the "it's not running at all" sort.

Normally, I'd start without any active components installed, and check power supply values at all appropriate places.

Then install serial interface circuitry (FTDI, Max232, transistors, or just wires) and do loopback tests to confirm that part of the circuitry.

Then install the CPU, preferably with some pre-installed program (the bootload qualifies) so that it can be checked.

And then the rest of the components related to whatever customization you had done.

Ah, thanks for the pin-13 suggestion. The board does not have such an LED but I can easily add one to see if it is running at all.

The serial interface is an external FTDI adapter - I'm using the six-pin Arduino Pro style interface. By "loopback test" do you mean placing a jumper across holes 2 and 3 on the chip socket, then seeing if I can echo data down the serial line?

The first board has a working power supply; I didn't bother to install the power supply on the second board, just mounted the arduino, crystal, capacitors, and resistor, and used the FTDI adapter to supply power.

The first board has an LCD panel whose LED backlight comes on when I attach the FTDI adapter, so I know that the power planes are working (besides having tested them with a multimeter).

Again with design files or pictures, any help that can be given are wild guesses.

westfw - thanks for the tip; I poked a multimeter at pin 13, and sure enough the voltage is flipping high, low, high, low. So the chip is running; I just can't talk to it. Continuity is good between the TX and RX pins on the FTDI adapter and the appropriate pins on the ATMega328, and neither line is shorted to Vcc or GND.

Is it possible that having too long a trace between the FTDI adapter pins and the processor might cause some kind of problem? Picking up noise or something? It is only a few inches long, which doesn't seem like a big deal to me, but for all I know this kind of thing is very sensitive.

James C4S: Thanks for offering to help. I'll see if I can get some kind of printed representation of the layout to show.

Is it possible that having too long a trace between the FTDI adapter pins and the processor might cause some kind of problem? Picking up noise or something? It is only a few inches long, which doesn't seem like a big deal to me, but for all I know this kind of thing is very sensitive.

I wouldn't think so. It's more likely that they're connected wrong (Tx to tx, rx to rx, rather than the other way around), or you have the FTDI adapter plugged in backward, or something like that. Did you retain the resistors between the FTDI connection and the AVR? Are they the correct values? Is there anything else connected to those pins of the AVR?

There are no resistors between the ATMega328's pins 2/3 and the FTDI adapter pins; the only resistor on the board I'm looking at is a pull-up on RESET. I based this on the schematic for the Arduino Pro Mini and did not see any extra resistors there, but now that I look at the Arduino Pro schematic, I see a pair of 1K resistors in line between RX/TX and the "digital pin 0" / "digital pin 1" sockets. It doesn't look like those resistors are connected to the 6-pin FTDI header, though.

I don't really understand what these resistors are for. Trying to drop the voltage...?

The TX pin will eventually be connected to a hex inverter, but I haven't soldered that in yet. Right now it's just a trace winding along the board through a couple vias.

I don't really understand what these resistors are for.

the idea is to allow things connected "directly" to pin 0/1 to "overpower" the FTDI chip, so that the pins are "transparently" multi-purpose.

Ah, thanks - so it's the same idea as a pull-up/pull-down resistor?

My original post mentioned two projects; I gave up on the first one, glued an Arduino Pro Mini on the back, and soldered on a bunch of jumpers. The second board, though, I'm still trying to debug. Here is the schematic:

http://www.redecho.org/steadyrocker.pdf

The only bit I've implemented is the bottom-left corner and J2; there's no power supply and I have not added any of the buttons or encoders. Also, I haven't added C9. There are two more schematic pages showing the LEDs and the MIDI interface, but I haven't soldered on any of those components yet either.

The PCB layout is an ExpressPCB file:

http://www.redecho.org/steadyrocker.pcb

Here is a close-up of the layout showing the part with the ATMega328:
http://www.redecho.org/steadyrocker_pcb_fragment.png

The red lines are on the top of the board; the green lines are on the underside. Unfortunately this view does not show the filled plane connections. The red line leading off the top of the page is the TX line leading to the MIDI interface.