Following on from this question, Problem with programming an ATtiny85: Error - avrdude: Yikes! Invalid device signature,
if the response from avrdude
is 0x000000
then the internal oscillator is probably not being used and an external one (be that crystal or clock signal) is required.
However, as this menu, from Engbedded Atmel AVR® Fuse Calculator, shows, there are a lot of options:
So, instead of having to configure circuits for each of the options, in turn, until the ATtiny responds, is there any way that I can read which of the CKSEL
and SUT
fuses are set?1
Background
I am using a Nano/Uno as an ISP programmer, and the ATtiny is on a dev board like this (although it would be the same issue if I were to use a breadboard):
I know for sure that the connections are fine as I have checked them from pin to pin of the two ICs (ATmega328PU to ATtiny85), using a DMM.
I am receiving 0x000000
as in:
avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.
because the ISP programmer can't read the ATtiny, because an external clock source has been set via the fuses. However, I wish to know how to read which clock source has been specified, without having to manually try all of the circuit permutations.
I don't think that just connecting a crystal (and two ceramic capacitors) will work if the exact setting, i.e. external clock, has been selected. However, if a 16MHz crystal works for all, or any, of the external clock settings then that would be great, but I'm sure it doesn't work like that, as you can have a crystal attached but the it might not be used, see Does device signature 0x000000 mean the atmega is bad:
Even though you have a crystal connected, that does not mean it is oscillating. For example, IF you set fuses for "External Oscillator", that will turn the crystal oscillator off.
When I move the ATtiny85 to a breadboard and add a crystal (16 MHz) and two 22 pF capacitors, the error has changed for the better (at least now it sees that a ATtiny is connected)
avrdude: Device signature = 0xff0000
avrdude: Expected signature for ATtiny85 is 1E 93 0B
Double check chip, or use -F to override this check.
Interestingly the signature varies:
0xff0000
0x00ffff
0xff00ff
When I add an external power supply to the ATtiny on the breadboard, following advice from Atmega (any chip) Device Signature issues and stk500_getsync()(resolutions), then unfortunately the device signature in the response returned by avrdude
reverts back to 0x000000
avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.
1 This is, admittedly, a bit chicken-and-egg, as if I can't communicate with the ATtiny, due to the incorrect clock setting, then how can I read which fuses have been set..? It's a bit like saying "If I don't have petrol in my car, then how can I drive to the petrol station to fill up?" - but I was hoping that there might be some sort of time saving measure
0x000000
, unfortunately.