Hello all!
Im having problems flashing my ATTiny85 chip and I wondered if anyone could help me please?
I have a circuit thats very simple, involving a screen and this surface mount chip. I've bought 100 of them brand new from RS, here in the UK. I've breadboarded the design using a through-hole version of the chip and that all works fine.
I'm using a buspirate v3 and avrdude under Arch linux to do the flashing, with avr-gcc.
Sadly, my surface mount version doesn't work. I've checked all the connections and even tried a second chip. No dice. Here is the output from avrdude
sudo avrdude -c buspirate -p t85 -P /dev/ttyUSB0 -U flash:w:invite.rom -Ulfuse:w:0x42:m -Uhfuse:w:0xdf:m -U efuse:w:0xff:m -F
Attempting to initiate BusPirate binary mode...
avrdude: Paged flash write enabled.
avrdude: initialization failed, rc=-2
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x489bd2
avrdude: Expected signature for ATtiny85 is 1E 93 0B
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude done. Thank you.
make: *** [Makefile:5: all] Error 1
[oni@motoko WeddingInvite]$ vim Makefile
[oni@motoko WeddingInvite]$ make
avr-gcc -I./include/ src/invite.c src/softspi.c src/smallfont.c -Os -o invite.elf -mmcu=attiny85
avr-objcopy -O ihex invite.elf invite.rom
sudo avrdude -c buspirate -p t85 -P /dev/ttyUSB0 -U flash:w:invite.rom -Ulfuse:w:0x62:m -Uhfuse:w:0xdf:m -U efuse:w:0xff:m -F -v
avrdude: Version 6.3, compiled on Feb 21 2016 at 13:33:25
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "/etc/avrdude.conf"
User configuration file is "/root/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/ttyUSB0
Using Programmer : buspirate
AVR Part : ATtiny85
Chip Erase delay : 4500 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 6 4 0 no 512 4 0 4000 4500 0xff 0xff
flash 65 6 32 0 yes 8192 64 128 4500 4500 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 : BusPirate
Description : The Bus Pirate
Attempting to initiate BusPirate binary mode...
BusPirate binmode version: 1
BusPirate SPI version: 1
avrdude: Paged flash write enabled.
AVR Extended Commands not found.
avrdude: initialization failed, rc=-2
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x480bf3
avrdude: Expected signature for ATtiny85 is 1E 93 0B
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
BusPirate is back in the text mode
avrdude done. Thank you.
What I'm seeing here is the signature is changing each time This suggests some kind of clock issue right?
My design does not have an external clock - its very simple and I believe that ATTiny85-20SU are set to use a 1MHz internal oscillator by default, which is what I'd like. Can anyone see where I've gone wrong? Do I need to wire in some kind of crystal just for the first flashing?
Cheers
Ben