Hey guys,
Fairly common problem i guess, at least based on Google results. I not able to talk to a TQFP atmega328p on a custom pcb.
Problem:
When i try to program using avrdude i get:
avrdude: stk500v2_command(): command failed
avrdude: stk500v2_program_enable(): bad AVRISPmkII connection status: Unknown status 0x00
avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
avrdude: Expected signature for ATMEGA328P is 1E 95 0F
So yeah, something is wrong. The power is 3.8v, i have a 10k pullup on the reset line and a 16MHz crystal with 22pF caps. Every vcc pin has a .1uF cap. All normal stuff, but for some reason it' not working.
I've measured continuity on all SPI pins, everything looks good. However when i look at the crystal pins with a scope i get a steady 1.8v on one pin and 2.6v on on the other. It's no oscillating as it should, which i'm guessing is causing the problems..
Board layout with the crystal lines highlighted:
I've tried replacing the crystal with another one. I also replaced the MCU. No change in either case..
I also tried building a barebones arduino based design on a breadboard and hooked the crystal lines into this board. This worked (!?). So maybe it's no the crystal after all?
There's a MAX6675 on the SPI lines too, could this cause issues with programming?
Any suggestions on what i should try next to try to find the problem? Is there a way to somehow test that the MCU is still alive, i guess it's possible it got fried from the heat while soldering?..
Here's the schematic too:
Any pointers are greatly appreciated!