0
\$\begingroup\$

I'm trying to read fuses for ATTINY85 using avrdude on Linux. I have Pololu PGM03A hardware programmer. I connected the ISP header to ATTINY85 the following way, except I'm not using crystal:

enter image description here

I verified all the connections with multi-meter. Now I ran the following command:

avrdude -c avrisp2 -p t85 -P /dev/ttyACM0 -b 19200 -v -B 4.0

I also tried setting -B to 250.0, but still the same output:

    avrdude: Version 6.1, compiled on Sep  8 2015 at 09:40:37
         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 "/home/k/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyACM0
         Using Programmer              : avrisp2
         Overriding Baud Rate          : 19200
         Setting bit clk period        : 4.0
         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          2    0      0     0     0 0x00 0x00

         Programmer Type : STK500V2
         Description     : Atmel AVR ISP mkII
         Programmer Model: STK500
         Hardware Version: 15
         Firmware Version Master : 2.10
         Topcard         : Unknown
         Vtarget         : 0.0 V
         SCK period      : 8.7 us
         Varef           : 0.0 V
         Oscillator      : 3.686 MHz

avrdude: stk500v2_command(): command failed
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

As far as I understood, ATTINY85 can run and be programmed without external crystal at 16MHZ, all I want to do is read the current fuse configuration and set it to run at 16MHZ so it can be programmed without any crystals and capacitors.

I had the same problem with ATMEGA328P, but connecting external power source to micro-controller solved the problem. I tried to do the same for ATTINY85, but still the same problem persists.

Any tips? Thanks

UPDATE: I added 16MHz crystal to pins 2 and 3 as well as 22pF capacitors connected between each crystal pin and the ground, but still the same problem persists.

[![enter image description here][2]][2]

\$\endgroup\$
  • \$\begingroup\$ What is the history of the chip? Depending on what fuses are programmed this may not be workable at all, or it may only work with a crystal connected or an external clock supplied. Typically it should work with a new out of the box chip, but if it is used by you or especially from a product there may be issues. \$\endgroup\$ – Chris Stratton Oct 16 '16 at 21:41
  • \$\begingroup\$ @ChrisStratton thanks for the response. The chip is completely blank from local electronics store. Does that mean if it's "fused" to 1MHZ, I won't be able to communicate with it, till I add external crystal and change to fuses to 16MHZ? or can I do this without the external crystal? Thanks! \$\endgroup\$ – 0x29a Oct 16 '16 at 21:46
  • \$\begingroup\$ If it is a new chip it will be 1MHz internal osc by default, so programming can be done without an external osc. Have you included a pull up resistor on the reset pin? \$\endgroup\$ – Tom Carpenter Oct 16 '16 at 21:54
  • \$\begingroup\$ A new one should be fused to run from the internal oscillator and accept ISP at a reasonable speed. Double check your wiring. How are your powering the ATtiny? The manual for your programmer explicitly says that is cannot power the target - the VDD pin on the programmer is a sense input (though it would probably be easy to modify). \$\endgroup\$ – Chris Stratton Oct 16 '16 at 21:54
  • 1
    \$\begingroup\$ @IgnacioVazquez-Abrams it's talking to the programmer fine, otherwise you wouldn't get the read back from the programmer shown in the post. The fact that what is being read back is nonsense in some places (e.g. Vtarget) is irrelevant, it's purely because the programmer is an incomplete emulation. \$\endgroup\$ – Tom Carpenter Oct 16 '16 at 22:08
2
\$\begingroup\$

Turns out the ISP header in the image I posted was wrong:

WRONG!

here's the correct pinout, RESET/GND needed to get 'flipped' with MISO/VCC:

CORRECT

Thank you everybody for helping. Especially ChrisStratton for pointing me the right direction. I can successfully read the fuses without external crystal:

avrdude -c avrisp2 -p t85 -P /dev/ttyACM0 -b 19200 -v -B 250.0
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.07s

avrdude: Device signature = 0x1e930b
avrdude: safemode: lfuse reads as 62
avrdude: safemode: hfuse reads as DF
avrdude: safemode: efuse reads as FF

avrdude: safemode: lfuse reads as 62
avrdude: safemode: hfuse reads as DF
avrdude: safemode: efuse reads as FF
avrdude: safemode: Fuses OK (E:FF, H:DF, L:62)
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.