ATMega328p Based HAB Tracker PCB Issue Uploading Sketch

Hi all,

I’ve been working on a project which is based around an ATMega328p-AU. After creating a schematic and a prototype, I created a PCB and ordered it along with the other components. After getting everything and doing some SMD soldering, I went to burn the bootloader and everything worked fine. I tried the pro mini bootloader using an external 8mhz oscillator as well as a bootloader for the atmega using the internal oscillator. I then went and hooked up my ftdi board and tried uploading a simple blink sketch.

Alas, I knew that my luck had been too good so that far, and I got this error for both bootloaders:

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x30
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x20
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x30
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x20
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x30
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x20
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x30
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x20
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x30
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x20
An error occurred while uploading the sketch

I made sure everything was correct on the software side and even tried it on a different computer with no success. I pulled out my multimeter to make sure everything was connected properly and I realized that I wired the reset button wrong, so I pulled it out and shorted reset to VCC, no luck. The PCB has a GPS module which is attached to the hardware serial port. I was told that if I attached a 1k resistor in between the TX of the GPS and the RX of the ATMega that I would be able to upload sketches (Usually if there is something else connected to hardware serial this error happens). I straight up went a cut the GPS TX trace going to the ATMega and that still didn’t change anything. I checked all the other pins and everything else seems to be in check. I’m not sure what to do at this point. The schematic is below.

Noah

Schematic_APRSTracker_2020-07-08_20-33-49.pdf (88.4 KB)

If you are trying to use just the ‘PROG’ header to upload using a USB-Serial adapter, then the problem is because you haven’t connected the DTR line of the USB-Serial adapter to the reset line of the ATMega328P.

Seriously, not one 0.1uF decoupling cap in the whole design?
You need at least 4:
VCC pin 4, cap to Gnd
VCC pin 6, cap to Gnd
AVCC pin 18, cap to Gnd.
Aref, cap to Gnd.

Get some caps with leads and tack them on somehow.

Need current limit resistors on your LEDs also. When they fail shorted, that will take your pins out, and the chip shortly after.

If you had DTR coming in from the PROG header going to Reset, that would be another.

If your bootloader is working, Press & Hold Reset, then start a serial download.
When you see these lines

Sketch uses 2596 bytes (8%) of program storage space. Maximum is 32256 bytes.
Global variables use 237 bytes (11%) of dynamic memory, leaving 1811 bytes for local variables. Maximum is 2048 bytes.

release Reset. Might take a couple of tries to get the timing down.

Go to File:Preferences and turn on Verbose outputs to see that message.

CrossRoads:
Seriously, not one 0.1uF decoupling cap in the whole design?
You need at least 4:
VCC pin 4, cap to Gnd
VCC pin 6, cap to Gnd
AVCC pin 18, cap to Gnd.
Aref, cap to Gnd.

Get some caps with leads and tack them on somehow.

Need current limit resistors on your LEDs also. When they fail shorted, that will take your pins out, and the chip shortly after.

If you had DTR coming in from the PROG header going to Reset, that would be another.

If your bootloader is working, Press & Hold Reset, then start a serial download.
When you see these lines

Sketch uses 2596 bytes (8%) of program storage space. Maximum is 32256 bytes.

Global variables use 237 bytes (11%) of dynamic memory, leaving 1811 bytes for local variables. Maximum is 2048 bytes.



release Reset. Might take a couple of tries to get the timing down.

Go to File:Preferences and turn on Verbose outputs to see that message.
![forumDesign.JPG|1144x798](upload://b9T0gq8LhQNX4uJJxyy4sFN14VI.jpeg)

Ah thank you for the info. Looks like there is going to be a second prototype coming soon. I'll definitely stick on some of those decoupling caps and try the reset idea. Gotta be honest I've learned more about debugging and prototyping in these few hours I've had the parts then in the months I've been researching about them. Thanks again.

Noah

Noah517:
Ah thank you for the info. Looks like there is going to be a second prototype coming soon.

Check the circuit on a breadboard or stripboard layout first.