Offline
Newbie
Karma: 0
Posts: 25
|
 |
« on: May 10, 2012, 07:27:02 am » |
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
Tesla Member
Karma: 97
Posts: 6382
|
 |
« Reply #1 on: May 10, 2012, 08:49:57 am » |
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
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 25
|
 |
« Reply #2 on: May 10, 2012, 09:04:28 am » |
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
Tesla Member
Karma: 97
Posts: 6382
|
 |
« Reply #3 on: May 10, 2012, 12:54:03 pm » |
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
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 25
|
 |
« Reply #4 on: May 10, 2012, 06:59:13 pm » |
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... 
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Offline
Shannon Member
Karma: 120
Posts: 10182
|
 |
« Reply #5 on: May 10, 2012, 08:45:36 pm » |
Damaged / defective jumper wire?
Has the ATtiny85 ever been programmed or is it fresh from the factory?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 25
|
 |
« Reply #6 on: May 11, 2012, 07:17:42 am » |
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
Edison Member
Karma: 13
Posts: 1541
|
 |
« Reply #7 on: May 11, 2012, 09:22:03 am » |
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
Newbie
Karma: 0
Posts: 25
|
 |
« Reply #8 on: May 11, 2012, 10:04:01 am » |
In preferences. You can turn verbose "on" for both compiling and uploading.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Offline
Shannon Member
Karma: 120
Posts: 10182
|
 |
« Reply #9 on: May 11, 2012, 12:49:04 pm » |
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
Newbie
Karma: 0
Posts: 25
|
 |
« Reply #10 on: May 11, 2012, 05:05:50 pm » |
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
Shannon Member
Karma: 120
Posts: 10182
|
 |
« Reply #11 on: May 11, 2012, 05:28:10 pm » |
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
Newbie
Karma: 0
Posts: 25
|
 |
« Reply #12 on: May 11, 2012, 07:02:29 pm » |
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
Shannon Member
Karma: 120
Posts: 10182
|
 |
« Reply #13 on: May 11, 2012, 09:14:11 pm » |
Yes.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 25
|
 |
« Reply #14 on: May 12, 2012, 07:23:24 am » |
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
|
|
|
|
|
|