Cape Town, ZA
Offline
Newbie
Karma: 0
Posts: 24
|
 |
« on: January 03, 2013, 02:57:28 pm » |
I have an Arduino Uno R3 board and successfully used it to program my first ATtiny85. I followed the MIT Media Lab instructions and, in burning the Bootloader, selected "ATtiny85 (with internal 8MHz clock)" in Tools>Board.
Moving on to my second ATtiny85 I got careless and, in burning the Bootloader, I accidentally selected "ATtiny85 (with external 20MHz clock)" - the next one down in the Tools>Board list. When I subsequently tried to re-burn the Bootloader having now selected "ATtiny85 (with internal 8MHz clock)" I get the following error message:
"Yikes! Invalid device signature. Double check connections and try again, or use -F to override this check."
Is there an easy way to put this right? I am very much of a beginner.
What does "use -F" mean and would that solve the problem?
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Online
Shannon Member
Karma: 116
Posts: 10132
|
 |
« Reply #1 on: January 03, 2013, 03:02:46 pm » |
Do you have a crystal + capacitors? Or a resonator?
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Online
Shannon Member
Karma: 116
Posts: 10132
|
 |
« Reply #2 on: January 03, 2013, 03:03:20 pm » |
What does "use -F" mean and would that solve the problem? Doesn't matter. No.
|
|
|
|
|
Logged
|
|
|
|
|
Cape Town, ZA
Offline
Newbie
Karma: 0
Posts: 24
|
 |
« Reply #3 on: January 03, 2013, 03:46:12 pm » |
Do you have a crystal + capacitors? Or a resonator?
No, yes, and no. I can go and buy a crystal (I've never worked with them though). Could you briefly explain what crystal to buy, how to connect it up, and the procedure? Many thanks for your speedy reply.
|
|
|
|
|
Logged
|
|
|
|
|
Valencia, Spain
Offline
Edison Member
Karma: 65
Posts: 2227
|
 |
« Reply #4 on: January 03, 2013, 04:11:46 pm » |
I have an Arduino Uno R3 board and successfully used it to program my first ATtiny85. I followed the MIT Media Lab instructions and, in burning the Bootloader, selected "ATtiny85 (with internal 8MHz clock)" in Tools>Board.
Moving on to my second ATtiny85 I got careless and, in burning the Bootloader, I accidentally selected "ATtiny85 (with external 20MHz clock)" - the next one down in the Tools>Board list. When I subsequently tried to re-burn the Bootloader having now selected "ATtiny85 (with internal 8MHz clock)" I get the following error message:
I find it helps if I remove the boards I don't own from boards.txt. Make the menu smaller, and avoids accidents. Is there an easy way to put this right? I am very much of a beginner.
What does "use -F" mean and would that solve the problem?
I've heard you can connect any clock source to the clock pin to make it run while you fix the fuses. Doesn't have to be 20mHz. Oscilloscopes and signal generators have square wave outputs...or maybe you can use the PWM signal from another Arduino...
|
|
|
|
|
Logged
|
|
|
|
|
Cape Town, ZA
Offline
Newbie
Karma: 0
Posts: 24
|
 |
« Reply #5 on: January 03, 2013, 04:27:48 pm » |
Do you have a crystal + capacitors? Or a resonator?
I have just found an old printed circuit board with what appears to be a crystal on it (oblong silver can, with two pins, and "XT1" marked on the pc-board next to it). The only marking on the can is 12000.SN so I have no idea if it will be of any use.
|
|
|
|
|
Logged
|
|
|
|
|
Cape Town, ZA
Offline
Newbie
Karma: 0
Posts: 24
|
 |
« Reply #6 on: January 03, 2013, 04:46:46 pm » |
I've heard you can connect any clock source to the clock pin to make it run while you fix the fuses. Doesn't have to be 20mHz.
Oscilloscopes and signal generators have square wave outputs...or maybe you can use the PWM signal from another Arduino...
Thanks. I mentioned in my other post that I did, I think, find a crystal. Do I simply connect its two terminals across pins 4 (GND) and 7 (SCK) of the ATtiny and see if I can then re-burn the (correct) bootloader?
|
|
|
|
|
Logged
|
|
|
|
|
Valencia, Spain
Offline
Edison Member
Karma: 65
Posts: 2227
|
 |
« Reply #7 on: January 03, 2013, 04:58:41 pm » |
Thanks. I mentioned in my other post that I did, I think, find a crystal. Do I simply connect its two terminals across pins 4 (GND) and 7 (SCK) of the ATtiny and see if I can then re-burn the (correct) bootloader?
It's pin 2 on a Tiny85... Give it a try, you can't do any harm. All you need is some pulses on that pin while you set the fuses.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Online
Shannon Member
Karma: 116
Posts: 10132
|
 |
« Reply #8 on: January 03, 2013, 05:36:29 pm » |
I can go and buy a crystal (I've never worked with them though). (Probably) no need. What are you using for a programmer? Do you have an Uno (or equivalent)?
|
|
|
|
|
Logged
|
|
|
|
|
Cape Town, ZA
Offline
Newbie
Karma: 0
Posts: 24
|
 |
« Reply #9 on: January 04, 2013, 05:50:04 am » |
Thanks. I mentioned in my other post that I did, I think, find a crystal. Do I simply connect its two terminals across pins 4 (GND) and 7 (SCK) of the ATtiny and see if I can then re-burn the (correct) bootloader?
It's pin 2 on a Tiny85... Give it a try, you can't do any harm. All you need is some pulses on that pin while you set the fuses. Success!! This is what I've done: 1. Your comment about the pin told me I needed to do some homework. So I looked up the data sheet for the ATtiny85. (As they say, if all else fails read the instructions.) In paragraph 6.2.6 it shows you how to connect up a crystal. 2. I carefully unsoldered the crystal from the old PC-board I happened to have lying around, as well as two surface-mount components next to it, which I assumed to be the required capacitors. 3. Apart from the usual connections between the Arduino board and the ATtiny85 required to burn the Bootloader, I connected the crystal between pin 2 (XTAL1) and pin 3 (XTAL2) of the ATtiny, the one capitor between pin 4 (GND) and pin 2 and the other capacitor between pin 4 and pin 3. 4. I then re-burnt the Bootloader, this time having selected the correct board, and it worked first time. Unfortunately I have no idea what the values of the crystal and capacitors are.
|
|
|
|
|
Logged
|
|
|
|
|
Cape Town, ZA
Offline
Newbie
Karma: 0
Posts: 24
|
 |
« Reply #10 on: January 04, 2013, 05:54:50 am » |
(Probably) no need. What are you using for a programmer? Do you have an Uno (or equivalent)?
As mentioned in my other post the problem has been solved. For what it's worth, I used the ArduinoISP sketch and an Arduino Uno R3 board. Thanks again.
|
|
|
|
« Last Edit: January 04, 2013, 01:31:18 pm by Coding Badly »
|
Logged
|
|
|
|
|
Valencia, Spain
Offline
Edison Member
Karma: 65
Posts: 2227
|
 |
« Reply #11 on: January 04, 2013, 06:15:07 am » |
Success!!
Yay! Unfortunately I have no idea what the values of the crystal and capacitors are.
Who cares, it oscillated! Now you need to delete the "bad" entry from your boards.txt file so it can't happen again... 
|
|
|
|
« Last Edit: January 04, 2013, 08:28:56 am by fungus »
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 114
Posts: 2205
|
 |
« Reply #12 on: January 04, 2013, 07:09:05 am » |
Burnt wrong bootloader on ATtiny85 - how to correct? Would burning the right bootloader correct it?
|
|
|
|
|
Logged
|
|
|
|
|
Cape Town, ZA
Offline
Newbie
Karma: 0
Posts: 24
|
 |
« Reply #13 on: January 04, 2013, 09:37:30 am » |
Burnt wrong bootloader on ATtiny85 - how to correct? Would burning the right bootloader correct it? You had me worried there for a moment, because I hadn't actually tried loading a sketch to the ATtiny. But I have now done so and it does work. So, as far as I am concerned, it did correct what the previous (wrong) bootloader did.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Online
Shannon Member
Karma: 116
Posts: 10132
|
 |
« Reply #14 on: January 04, 2013, 01:37:02 pm » |
For future reference, it's fairly easy to get a board running the ArduinoISP sketch to output an appropriate clock signal. LadaAda published a modified ArduinoISP sketch, I published a version, Nick Gammon published relevant code, and you can probably find a snippet in the forum.
Armed with a modified ArduinoISP sketch, you simply connect the clock output (an Arduino pin) to the XTAL1 pin on the target and re-burn the bootloader.
Good job extracting the crystal!
|
|
|
|
|
Logged
|
|
|
|
|
|