I uploaded a sketch selecting the external oscillator option (without having one), now I'm trying to undo it and get the internal clock working, but it don't start. I followed some posts here and try to solve the problem, but I always get the same error:
System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"
Using Port : COM3
Using Programmer : stk500v1
Overriding Baud Rate : 19200
AVR Part : ATtiny85
Chip Erase delay : 400000 us
PAGEL : P00
BS2 : P00
RESET disposition : possible i/o
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 12 4 0 no 512 4 0 4000 4500 0xff 0xff
flash 65 6 32 0 yes 8192 64 128 30000 30000 0xff 0xff
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
calibration 0 0 0 0 no 2 0 0 0 0 0x00 0x00
Programmer Type : STK500
Description : Atmel STK500 Version 1.x firmware
Hardware Version: 2
Firmware Version: 1.18
Topcard : Unknown
Vtarget : 0.0 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.05s
avrdude: Device signature = 0x000000 (retrying)
Reading | ################################################## | 100% 0.05s
avrdude: Device signature = 0x000000 (retrying)
Reading | ################################################## | 100% 0.06s
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.
My steps were:
1-Set a clock with an Arduino Mega with the following code:
void setup()
{
setup2560();
}
void setup2560()
{
// OC0A is PB7, i.e. D13
pinMode(13, OUTPUT);
// PWM mode, non-inverted
TCCR0A = (3<<WGM00) | (2<<COM0A0);
// use Output Compare Register A, no prescaling
TCCR0B = (1<<WGM02) | (1<<CS00);
// Output Compare Register A
OCR0A = 4;
}
void loop()
{
}
2- Wire an Arduino Uno to work as ISP into the Attiny85 (including the output from the Arduino Mega)
3- Upload the Blink example with the Attiny board selected and 8Mhz internal clock
Try using the Adafruit ArduinoISP sketch from github, which provides a clock signal on pin 9 of the programmer Arduino. Attach that pin 9 signal to XTAL1 pin of the ATtiny85.
With the Adafruit ArduinoISP sketch you need to connect the SS pin of the Mega to RESET of the ATtiny85. That would be pin 53. Or you can edit the sketch before you upload it and change "#define RESET SS" to "#define RESET 10"
On the Mega 2560 running the Adafruit ArduinoISP sketch:
MISO is pin 50
MOSI is pin 51
SCK is pin 52