I'm using an FTDI-based bit-bang programmer for my AVR MCUs with AVRDUDE. It works perfectly with ATmega32A, but does not work with ATtiny45.
The command that I use to try if it works is:
avrdude.exe -c pinb -P ft0 -B 4800 -U lfuse:r:-:h -F
The -c pinb
stands for the following config:
miso = 6; # DCD
sck = 5; # DSR
mosi = 3; # CTS
reset = 7; # RI
For ATmega32A (-p m32
) I get:
ft245r: bitclk 4800 -> ft baud 2400
avrdude.exe: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude.exe: Device signature = 0x1e9502
avrdude.exe: reading lfuse memory:
Reading | ################################################## | 100% 0.02s
avrdude.exe: writing output file "<stdout>"
0xe4
For ATtiny45 (-p t45
) I get:
ft245r: bitclk 4800 -> ft baud 2400
avrdude.exe: ft245r_program_enable: failed
avrdude.exe: initialization failed, rc=-1
avrdude.exe: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude.exe: Device signature = 0xffffff
avrdude.exe: Yikes! Invalid device signature.
avrdude.exe: Expected signature for ATtiny45 is 1E 92 06
avrdude.exe: safemode: lfuse reads as FF
avrdude.exe: safemode: hfuse reads as FF
avrdude.exe: safemode: efuse reads as FF
avrdude.exe: reading lfuse memory:
Reading | ################################################## | 100% 0.02s
avrdude.exe: writing output file "<stdout>"
0xff
avrdude.exe: safemode: lfuse reads as FF
avrdude.exe: safemode: hfuse reads as FF
avrdude.exe: safemode: efuse reads as FF
avrdude.exe: safemode: Fuses OK
avrdude.exe done. Thank you.
Note that everything is read as 0xFF.
I've already check the wiring multiple times. The MCU is in its stock state, without any firmware or fuse changes. Why doesn't it work?
Edit 1: specifying bitclock/baudrate. As suggested in the comments, I've tried to reduce the communication speed. Unfortunately, the windows version of AVRDUDE 5.3.1 didn't correctly recognize the -B and -b options. So I've compiled the latest AVRDUDE 5.11.1 with ft245r.patch from bug #30559: Ft232 bit-bang support on Ubuntu. Now I'm able to get for example baudrate = 200, but still no success.
Edit 2: voltmetering the wires. As I run AVRDUDE on low speed, I monitor the 4 outputs (MOSI, MISO, SCK, RESET) with a voltmeter. All of them change, except for the MISO wire - it seems to stay on the high level. Probably I have two broken chips?