After toying around with arduino's for quite a while, I wanted to design my own PCB that would be programmable with the arduino IDE and that would integrate a RFM95 LoRa radio.
I now got the boards, and got the basic components that should make up the "arduino" soldered on, but I'm having trouble getting it to do anything. I used a atmega328, and this schema:
When I connect a FTDI to program it, it seems I'm unable to get any sketch on it, the atmega does however seem to get power.
I than realized that when using a blank atmega, I probably would first have to burn a bootloader onto it, so I hooked up this programmer that I had lying around (previously used it to program a attiny), and connected SCK, MOSI,MISO, VCC and GND.
I then tried to program the bootloader by going to tools --> burn bootloader, using USBasp as the programmer in the arduino IDE.
I then got this error:
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: error: program enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
Error while burning bootloader.
Any idea what I could try next to get the pcb going? or are there maybe design errors in my pcb?
The wires seem to be connected correctly. 5V and 3V3 should work both if it is not in conflict with other parts, but for breadboard wiring the higher voltage is better. Hard to say now. Provide more verbose output include the command.
With the DMM, you could check the voltage on MCU and also reset if it is initiated correctly.
NOTE: ATmega328 and ATmega328P differ. Evil is in details.
Since I wasn't getting more verbose output form the arduino IDE, I resorted to the command line. After some fiddling around, I figured this could be the command to burn the bootloader:
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: error: program enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x000000 (retrying)
avrdude: Device signature = 0x000000 (retrying)
avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
avrdude: Expected signature for ATmega328P is 1E 95 0F
avrdude done. Thank you.
From this, i think I can conclude there's just no communictaion between the programmer and the fresh ATMEGA 328p chip. I soldered together another board, with just the minimal components (atmega, resistors, crystal and capacitors) because it could very well be my non-existing soldering skils causing the problem, but with the new boards, I had the same issue, no communication at all...
So I guess I have to do some more trial and error.
If you can spot what's wrong in this image, let me know.
Do not use -F! I know it is in the error message but more important part is "double check your connection". BTW, more verbose output can be obtained with -v (up to -vvvv).
Zeros in response means that it doesn't communicate at all. First thing is to have the HW okay. Check it for any short or 'cold' connections. Check the voltage VCC and ISP wiring. If you have minimal circuit, it means crystal and reset circuit and VCC. After powering, you could check the oscillator. Should be about VCC/2 on XTAL1 pin. You should be able to upload to the chip via ISP even without the crystal.
You have to go step by step form the minimal to full circuit.
EDIT: You can omit -U and -e for testing purpose. It will read signature which is enough to find out whether it works or not. Eventually, add -v.
Look at C5 and make sure you are connecting the Rst lead (Usbasp)on the side where you have the 10K resistor.
If I hook my Usbasp Rst lead through a .1uF Cap it fails just like yours.
Also, I notice you show a 20Mhz crystal and are trying to load a 8Mhz bootloader.