I have code written for attiny85 digispark boards and I have been able to program them successfully using the USB micronucleus method with Arduino IDE 1.8.19.
What I want to do now is program the same code using AVR ISP method, and blow away the bootloader. Reason is that I want the program to run when first powered up, not after seconds (10?) of the bootloader running looking to see if I want to program the chip again.
I've read that I can use the AVR ISP method, so I programmed an Arduino Nano and wired it up to the Digispark. Problem is that I cannot get the Arduino IDE to allow me to program the Digispark using the AVR ISP method, even though I've chosen it. Whenever I try to upload to the device, I get a prompt to "Please plug in the device (will time out in 60 seconds)".
Reading other posts, some folks have used the Adafruit Trinket as the device instead of Digispark. Problem is my code uses the DigiKeyboard library for button checking. I could change the code but would rather just figure out how to program a Digispark, as an attiny85, using the AVR ISP method.
What am I missing that I cannot get the AVR ISP mode to work?
Here's a screenshot showing that I am choosing the programmer as AVR ISP.
Are you using "upload Using Programmer"?
This is embarrassing - I didn't realize that was even there.
That was what I needed. Thanks! Now to figure out what this error is - wiring looks correct.
avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Users\xxxx\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.7.5/avrdude.conf"
Using Port : COM8
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 1 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.02s
avrdude: Device signature = 0x000000 (retrying)
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x000000 (retrying)
An error occurred while uploading the sketch
Reading | ################################################## | 100% 0.02s
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.
Hi @AlpineJoe. You should double check all your wiring. The "Device signature = 0x000000" happens when there is no communication at all between the programmer and the target board.
Wiring looks correct, verified it a few times. I am hooking up to the P0 - P5 pads on the Digispark board and not to the bare chip. Maybe one of the signals is shared with something else on the board and goofing up communications.
Maybe if you power it via its usb connector, by plugging it in a pc the USB conflicts. I use to power them from the Arduino directly, to be sure only the required connections are made.
Solved - I tied the attiny85 reset to the Nano reset instead of pin 10. Once I corrected that, the nano programmed with the AVR ISP programmed the attiny85 on the Digispark board.
Really appreciate all the help!