I have five Atmega328's, which I want to use for several (small) projects. Initial testing several months ago using the 'blink'-sketch worked, and I have recently started the projects up again. However, it now seems I cannot connect properly; I keep getting the 'invalid device signature'-error.
My setup:
So far, I tried three different breadboards (including a mini-breadboard on a prototype shield), all of the Atmega328's, replaced all wires several times, removed and replaced the oscillator crystal, and I even fell back to D11-D13 instead of the ICSP-header. Nothing seems to work.
The Arduino Uno seems to work properly using AVRdude, although I end up with the same error. Using the Arduino board detector/chip fuse detector by Nick Gammon also seems to be unable to detect the Atmega328. I do not think it is the crystal, since this sketch allows for me to use D9 as a oscillatory source (connected it to XTL1). The normal ArduinoISP-sketch simultaneously blinks the yellow (active) and red (error) lights, as seen in the pictures.
Testing the power and ground using a multimeter yielded no unexpected behaviour, and the cables leading from the Arduino Uno to the pins (reset and D11-D13 on the breadboard) show the cables not te be broken.
Tried that too just now; red error light still blinking, same output from AVRDude.
EDIT: if this was the problem, should the ArduinoISP sketch not fail/reset somewhere, which would make the gentle blinking of the yellow and red lights irregular?
Binary sketch size: 466 bytes (of a 30,720 byte maximum)
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.
AVRDude:
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.
avrdude done. Thank you.
The pictures might be a bit confusing, since there are two green wires, but the layout works like this:
D12 +
D13 D11
But I also tried the D11-D13 on the arduino side to no avail. Also, the breadboard is getting power in the correct manner, so the GND and +5V are correct.
Grumpy_Mike:
You also need some decoupling capacitors on that sta d alone board. At least one on the powerandanother on the Aref.
I've got decoupling capacitors on the individual project boards, but not on the programming board (I only had four), done in the way of this picture (courtesy of Nick Gammon):
Puting those caps so far away from the processor renders them next to useless. They should be as close to the processor as possible, right up to the pins.
The bottom capacitor should connect pin 7 and 8, and be between the pins and the wires leading to them.
The top capacitor should be between pins 22 and 20, and also between the pins and the wires.
Right now I'm only using a couple of capacitors around the power-drawing elements of my projects (small motor, temperature sensor which eats up quite a bit of power, that kind of stuff), and these two decoupling capacitors, but I've been told I should use a 1000uF capacitor near my power supply (battery with a solar panel, usually), for similar purposes. Would this be a good idea too?
It is a good idea to have what is called a bulk decoupling capacitor but that value is a bit excessive if only light current is being drawn. I would use 47uF or 100uF.
It is a motor that is a very large source of interference even a small one.
My tutorial is a Dutch book, which came with my first Arduino. I've been using it as reference material, but have found several major errors, including this one. I'll be feeding the book to the trashbin, and will use the internet for my informational needs.