I'm getting "An error occurred while uploading the sketch" when uploading a simple sketch to an ATTiny85 connected to my pc through a Sparkfun Tiny Programmer. The compilation goes through fine but there is no extra error info why this happens. Any clues?
Here's the code. In the Forum I found a guy who solved the problem by changing the programmer from AVRISP mkII to ArduinoISP but it gave me another error. I also tried to change to USBTinyISP which gave some errors but did blink the LED on the programmer.
Error code with AVRISP mkII:
avrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"
Using Port : usb
Using Programmer : stk500v2
An error occurred while uploading the sketch
avrdude: usbdev_open(): did not find any USB device "usb" (0x03eb:0x2104)
avrdude done. Thank you.
Error code with USBTinyISP:
avrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"
Using Port : usb
Using Programmer : usbtiny
avrdude: usbdev_open(): Found USBtinyISP, bus:device: bus-0:\\.\libusb0-0001--0x1781-0x0c9f
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 1 0 0 0 0 0x00 0x00
Programmer Type : USBtiny
Description : USBtiny simple USB programmer, https://learn.adafruit.com/usbtinyisp
avrdude: programmer operation not supported
avrdude: Using SCK period of 10 usec
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.01s
avrdude: Device signature = 0x1e930b (probably t85)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: Using SCK period of 10 usec
avrdude: reading input file "C:\Users\hans\AppData\Local\Temp\arduino_build_521023/Blink_ATtiny.ino.hex"
avrdude: writing flash (910 bytes):
Writing | ################################################## | 100% 2.53s
avrdude: 910 bytes of flash written
avrdude: verifying flash memory against C:\Users\hans\AppData\Local\Temp\arduino_build_521023/Blink_ATtiny.ino.hex:
avrdude: load data flash data from input file C:\Users\hans\AppData\Local\Temp\arduino_build_521023/Blink_ATtiny.ino.hex:
avrdude: input file C:\Users\hans\AppData\Local\Temp\arduino_build_521023/Blink_ATtiny.ino.hex contains 910 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 1.91s
avrdude: verifying ...
avrdude: 910 bytes of flash verified
avrdude done. Thank you.
Given the rest of the message I'd say that it has written correctly.
Incidentally, if you look at the Sparkfun hookup guide you'll see that USBTinyISP is the correct programmer selection to use.