Pages: [1] 2 3   Go Down
Author Topic: Attiny85 programming failing - Invalid device signature  (Read 10811 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm trying to program an Attiny85 using an Arduino Uno, but no luck...

With 1.0, following http://hlt.media.mit.edu/?p=1695:
Used arduino isp sketch from here: https://github.com/arduino/Arduino/blob/master/build/shared/examples/ArduinoISP/ArduinoISP.ino
Attiny definitions from here: https://github.com/damellis/attiny/zipball/Arduino1
Tried fixing baud rate from 19200 to 9600 as described here: https://github.com/arduino/Arduino/commit/80a2154279a02fd69f995ef6ff9eb889363c73ca

Sketch uploads ok unto the Uno, but when I try burning the tiny's bootloader (8Mhz internal osc)...

I get this
"avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny85
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check."

First one is dismissable, second one no... I read somewhere that it might be the UNo's reset that isn't being correctly prevented, and the programmer is trying to burn the bootloader unto the 328, hence the signature problem, but I tried with and without a 10uF capacitor between RESET and GND (and even a 100uF), but nothing...


Tried doing the programming with 0.22 (http://hlt.media.mit.edu/?p=1229) instead of 1.0 (both the arduino isp uploading and attiny bootloader burning) with provided attiny defs.
Same error message...


Weird thing is some months ago I tested programming the same chip and managed to get it to work by uploading the Arduino ISP sketch with 0.22, and then burning the bootloader. Going back to 1.0 worked fine.
Now I get the same error message on either version (0.22 or 1.0).
Checked and double checked all the connections, changed jumper cables, nothing...
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8940
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you turn on verbose output you will get to see the value of the received signature.  If it matches the ATmega328P then you are accidentally resetting the UNO.  If it is all 0's or all FF's you have an incorrect connection on the target processor.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm getting either "Device signature = 0x000000" or "Device signature = 0xffffff". Alternates when I re-connect the reset jumper on the tiny...
Changed all jumper cables again, but nothing changes...

Fried tiny? (hopefully no, as it's really hard to find them here in Portugal)
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8940
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sounds like one or more of the six connections to the ATtiny are misplaced or broken.

D10 -> Pin 1  (Reset)
Gnd -> Pin 4
D11 -> Pin 5  (MOSI)
D12 -> Pin 6  (MISO)
D13 -> Pin 7  (SCK)
+5V -> Pin 8
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That is (unfortunately) exactly how I have it connected...
Since I changed  all the jumper wires twice, and tested all the wires before the last switch, I'm kinda stumped on this one...

Arduino pins are all ok (tested input and output with blink and pushbutton sketches for each one), so my only guess is the tiny isn't working...  smiley-cry
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 209
Posts: 13018
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Damaged / defective jumper wire?

Has the ATtiny85 ever been programmed or is it fresh from the factory?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I programmed it some months ago, to test, and succesfully burned the bootloader and uploaded blink sketch.

Well, I might as well change jumpers again, but I tested them this last time I switched. I'll test and leave some feedback here.
Logged

Dubuque, Iowa, USA
Offline Offline
Faraday Member
**
Karma: 48
Posts: 2542
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you turn on verbose output you will get to see the value of the received signature. 

How do you turn on verbose output?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

In preferences. You can turn verbose "on" for both compiling and uploading.
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 209
Posts: 13018
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I programmed it some months ago, to test, and succesfully burned the bootloader and uploaded blink sketch.

Any possibility it has been set to use an external crystal / oscillator?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Actually now that you say it, that might be a possibility. I had a 16Mhz crystal lying around at the time, so it's possible I tried to set it to run with an external oscillator. Didn't think of that.
Anyway, even if i thought about it I would never have thought it'd be a necessity to connect it to reprogram it... (*noob*)
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 209
Posts: 13018
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


ISP programming requies a processor clock.  If the processor is configured to run from an internal oscillator then nothing special is needed for programming.  If the processor is configured for something else than a clock signal has to be present on the XTAL1 pin for programming.

I believe LadyAda has published an ArduinoISP version that outputs a "recovery clock".
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So in theory if I re-connect a crystal like I did back when i programmed it, I should be able to re-program it to use the internal clock?
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 209
Posts: 13018
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Yes.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Aaaaaand it works.
Connected a crystal and capacitators and burned bootloader ok.
Removed Crystal, uploaded blink sketch ok and all is working.

Awesome, thank you all very much!!
Logged

Pages: [1] 2 3   Go Up
Jump to: