Please help with my custom ATMega328 PCB

Thread Starter

skaman82

Joined Dec 5, 2018
15
Hi! I created a PCB for my newest Arduino project and its driving me mad by now. I am through several PCB variations and tried connecting to it (via FTDI first - then) via ISP but I fail every time and in each revision.

Tested all the pads/pins for a short - everything seems ok. On each board I soldered only the barebone components (2x 22pF, 1x100nF caps, 10k resistor, XTAL) to test it. I can often see tiny sparks between the pins when I trying to flash the chip - but I cant find any shots.

I am trying connecting my PCB through ISP with another arduino (ISP sketch on it / + #define old wiring).

I am pretty sure that C2 is not needed - but it also does not work without it.

I am very open to any ideas how to get this done because it is getting very expensive :). Build about 10 different boards now and can't find the issue.

Uploaded the latest schematic and some PCB pics.

schematic.png PCB_top.png PCB_bottom.png board connection.jpg IDE error.png
 
Last edited:

danadak

Joined Mar 10, 2018
4,057
You using a bare Piezo disk (inside case) or a buzzer with internal interface ?

A piezo, and a buzzer, can generate some HV due to its electro mechanical effects.

https://www.murata.com/~/media/webrenewal/support/library/catalog/products/sound/p37e.ashx

https://www.murata.com/en-us/support/faqs/products/sound/diaphragm/char/sch0001


So protect Arduino pin is short answer. I see some folks using R, otheres diodes to
supply rails.

Looking at PCB I see a thru hole on regulator (right hand pin of 3 pins) real close to
its center pin (ground), that checks out as not shorted ?

Try loading/soldering a boaprd with no UP on it, and check all the voltages....

Regards, Dana.
 
Last edited:

Thread Starter

skaman82

Joined Dec 5, 2018
15
You using a bare Piezo disk (inside case) or a buzzer with internal interface ?
> I don't know how this device its exactly called. It generates a tone when power is supplied. Me and a ton of other people using this buzzer on various arduino projects without any problems (and it is actually not connected to my issue - it does not makes a difference if the buzzer is connected on a fresh soldered pcb or not)

Looking at PCB I see a thru hole on regulator (right hand pin of 3 pins) real close to
its center pin (ground), that checks out as not shorted ?
> no that is actually fine

Try loading/soldering a boaprd with no UP on it, and check all the voltages....
> will do that, thanks!
 

Raymond Genovese

Joined Mar 5, 2016
1,653
No, the pads are hooked up exactly the same (you linked schematic uses just another symbol)
That is on your board - is the second Arduino board hooked (the one that produces sparks on your PCB) up in the same way? Just wondering because the ICSP connector pin numbers on an UNO, for example are ordered as in the schematic I linked to, but not like on your board. I could see how that could create confusion.

Edited to add:
 
Last edited:

Thread Starter

skaman82

Joined Dec 5, 2018
15
That is on your board - is the second Arduino board hooked (the one that produces sparks on your PCB) up in the same way? Just wondering because the ICSP connector pin numbers on an UNO, for example are ordered as in the schematic I linked to, but not like on your board. I could see how that could create confusion.
Here the routing of the wires in the photo:
Green wire bottom < GND > GND on "Arduino as ISP" device
Blue wire bottom < 17/SCK > D13 on "Arduino as ISP" device
White wire bottom < 5V > 5V on "Arduino as ISP" device
Yellow wire bottom < 15/MOSI > D11 on "Arduino as ISP" device
Black wire bottom < 16/MISO > D12 on "Arduino as ISP device"
Red wire bottom > NC (would be normally connected to reset through C2)

The blue wire on the top < 29/RESET > D10 on "Arduino as ISP" device

On the programming Arduino ISP I defined "USE_OLD_STYLE_WIRING"
Using an Arduino Mini for programming, hooked up on my FTDI adapter.

board connection.jpg
 
Last edited:

Raymond Genovese

Joined Mar 5, 2016
1,653
What kind of Arduino is the one you are using to burn the boot loader on your PCB? I'm just trying to help you troubleshoot and the tiny sparks sure sound like a short and you are saying that it happens when you attach the programmer Arduino through ICSP. So, that suggests the possibility that the source of the short is the ICSP connection with the other board. Both Vcc and GND are on those two connectors. Since you have carefully checked for shorts on your PCB and found none - it may be that there are none. That's my thinking.

Edit: It is a little tedious to follow the color wires - can you tell me what pins are connected on the ICSP connectors using numbers from your schematic and the programmer? Edited again - N/M you are doing that more or less in your last message. Let me think for a minute.
 

Thread Starter

skaman82

Joined Dec 5, 2018
15
What kind of Arduino is the one you are using to burn the boot loader on your PCB? I'm just trying to help you troubleshoot and the tiny sparks sure sound like a short and you are saying that it happens when you attach the programmer Arduino through ICSP. So, that suggests the possibility that the source of the short is the ICSP connection with the other board. Both Vcc and GND are on those two connectors. Since you have carefully checked for shorts on your PCB and found none - it may be that there are none. That's my thinking.
Using an Arduino Mini for programming, hooked it up on my FTDI adapter.

BTW: is it normal that I get 5v on the reset wire?
 
I appreciate your being patient and again, I am just trying to check out one thing.

Using this chart:


What pins on the Mini (for example, MISO is pin 16 on the Mini) are connected to what pins on your PCB ICSP (for example pin 5 is MISO on your PCB). Any and all connections from/to the two boards - including Vcc or GND if connected.
 

Thread Starter

skaman82

Joined Dec 5, 2018
15
I appreciate your being patient and again, I am just trying to check out one thing.

Using this chart:


What pins on the Mini (for example, MISO is pin 16 on the Mini) are connected to what pins on your PCB ICSP (for example pin 5 is MISO on your PCB). Any and all connections from/to the two boards - including Vcc or GND if connected.
Mini 14(D10) > RESET on my PCB
Mini 15(D11) > MOSI on my PCB
Mini 16(D12) > MISO on my PCB
Mini 17(D13) > SCK on my PCB
Mini VCC > 5V on my PCB
Mini GND > GND on my PCB



ok, Let me check those too and what program are you using on the pro mini - can you provide a link?

The ISP sketch is in the Arduino IDE samples:
Bildschirmfoto 2018-12-06 um 01.51.08.png





I did this code modification:
Bildschirmfoto 2018-12-06 um 01.51.37.png
 
Last edited:
I am comparing back and forth and I get the same for what the connections should be. Looking at your reset signal from the Pro Min, pin 14 to your PCB/ATMEGA pin 1 and compare it to this PIC from Gannon's board using an UNO - just paying attention to how that line (the green wire is connected.


You should have +5 from the mini go to a resistor (I guess it is 10K) and to both 14 (SS) on the mini and pin1 (reset) on your ATMEGA - however you get there on the board. Is that what you have?
 

Thread Starter

skaman82

Joined Dec 5, 2018
15
You should have +5 from the mini go to a resistor (I guess it is 10K) and to both 14 (SS) on the mini and pin1 (reset) on your ATMEGA - however you get there on the board. Is that what you have?
Yes, that is the case. Thats why I am freaking out a bit actually, everything seems to be correct but it is still not working.... and tiny sparks on the ATmega are a definitive sign that something is clearly wrong - I just can't find it
 
One last thing. Pin 14 (which will be GPIO 10 in the code) on the Pro Min is SS and should be the reset to your PCB. In your program - I can only see a portion and RESET is defined as 10 which is correct, but have you defined ARDUINO_HOODLOADER2 somewhere? I see the section starting ifndef ARDUINO_HOODLOADER2 - that is the part I mean.

EDIT: also, do you see sparks when you make the connections and power up the Pro Mini - or only after you run the program?
 

Thread Starter

skaman82

Joined Dec 5, 2018
15
One last thing. Pin 14 (which will be GPIO 10 in the code) on the Pro Min is SS and should be the reset to your PCB. In your program - I can only see a portion and RESET is defined as 10 which is correct, but have you defined ARDUINO_HOODLOADER2 somewhere? I see the section starting ifndef ARDUINO_HOODLOADER2 - that is the part I mean.

EDIT: also, do you see sparks when you make the connections and power up the Pro Mini - or only after you run the program?
It says "ifndef" = if NOT defined RDUINO_HOODLOADER2. It is the default configuration
 
It says "ifndef" = if NOT defined RDUINO_HOODLOADER2. It is the default configuration
OK. One last thing before I admit (temporary) defeat. You are not applying any power to your PCB I mean the only Vcc and GND going to your PCB when you try to program it is coming from the Pro Mini - right?
 
Top