Go Down

Topic: ATtiny! Damn that thing is tricky (Read 6654 times) previous topic - next topic

Static

#45
Apr 21, 2012, 02:37 pm Last Edit: Apr 21, 2012, 11:24 pm by Coding Badly Reason: 1
I'd never seen the verbose output before.  Here's what I got (I changed nothing from the the previous conditions, except enabling "Verbose Output").
Code: [Select]
C:\Programming Tools\arduino-1.0\hardware/tools/avr/bin/avrdude -CC:\Programming Tools\arduino-1.0\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -pattiny85 -cstk500v1 -P\\.\COM13 -b19200 -e -Uefuse:w:0xff:m -Uhfuse:w:0xdf:m -Ulfuse:w:0xe2:m

avrdude: Version 5.11, compiled on Sep  2 2011 at 19:38:36
        Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
        Copyright (c) 2007-2009 Joerg Wunsch

        System wide configuration file is "C:\Programming Tools\arduino-1.0\hardware/tools/avr/etc/avrdude.conf"

        Using Port                    : \\.\COM13
        Using Programmer              : stk500v1
        Overriding Baud Rate          : 19200
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]
        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
                                 Block Poll               Page                       Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          flash         65     6    32    0 yes      8192   64    128  4500  4500 0xff 0xff
                                 Block Poll               Page                       Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
                                 Block Poll               Page                       Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                 Block Poll               Page                       Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                 Block Poll               Page                       Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                 Block Poll               Page                       Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                 Block Poll               Page                       Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          calibration    0     0     0    0 no          2    0      0     0     0 0x00 0x00

        Programmer Type : STK500
        Description     : Atmel STK500 Version 1.x firmware
avrdude: Send: A [41] . [80]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [02]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [81]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [01]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [82]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [12]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [98]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
        Hardware Version: 2
        Firmware Version: 1.18
        Topcard         : Unknown
avrdude: Send: A [41] . [84]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [85]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [86]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [87]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [89]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
        Vtarget         : 0.0 V
        Varef           : 0.0 V
        Oscillator      : Off
        SCK period      : 0.1 us

avrdude: Send: A [41] . [81]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [01]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [82]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [12]
avrdude: Recv: . [10]
avrdude: Send: B [42] . [14] . [00] . [00] . [01] . [01] . [01] . [01] . [03] . [ff] . [ff] . [ff] . [ff] . [00] @ [40] . [02] . [00] . [00] . [00]   [20] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny85
avrdude: Send: P [50]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]
avrdude: AVR device initialized and ready to accept instructions

Reading | avrdude: Send: V [56] 0 [30] . [00] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: Send: V [56] 0 [30] . [00] . [01] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
################avrdude: Send: V [56] 0 [30] . [00] . [02] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
################################## | 100% 0.06s

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
        Double check connections and try again, or use -F to override
        this check.

avrdude: Send: Q [51]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]

avrdude done.  Thank you.


I have three other ATTiny85's if that will help (Two from Mouser that have never left the protective wrapping and case).  I'm more than willing to try different things to make this work.  If you have any tips, suggestions, trials, let me know.  


Moderator edit: quote tags changed to code tags.

Static

For completeness' sake, I just tried again (the whole process) using a newer Arduino Uno board.  Same results, same LED blinking behavior.  I did try loading the modified "Blink" sketch from the tutorial, pin 0 and pin 1 are lighting up the same as the previous attempts (which were using a different sketch, one to drive the pins HIGH continuously). 

I'm pretty sure I'm not writing to the ATTiny.

Coding Badly

#47
Apr 21, 2012, 08:38 pm Last Edit: Apr 21, 2012, 08:42 pm by Coding Badly Reason: 1
I'm pretty sure I'm not writing to the ATTiny.


Yup...

Quote
The heartbeat LED is constantly "beating".
...
        Hardware Version: 2
        Firmware Version: 1.18


Indicates that the ArduinoISP sketch is functioning correctly.

Quote
avrdude: Device signature = 0x000000


Indicates that the programmer (your Uno running the ArduinoISP sketch) is not communicating with the target (ATtiny85).  The most likely culprit is the wiring.  Make certain the target is powered (five volts across VCC and GND).  Carefully check the ISP wiring: MISO to MISO, MOSI to MOSI, SCK to SCK, programmer SS to target RESET, GND to GND.

Static

OK.  I'm going to run down the connections that I have while I'm trying to program the ATTiny.  Pin 1 of the ATTiny is ID'd by the small dot on the packaging.
Arduino                        ATTiny 85
Reset is connected to Ground with a 10uF capacitor
5v to Pin 8-ATtiny
GND to Pin 4-ATtiny
Pin 13 to Pin 7-ATtiny (SCK)
Pin 12 to Pin 6-ATtiny (MISO)
Pin 11 to Pin 5-ATtiny (MOSI)
Pin 10 to Pin 1-ATtiny (Reset)
Pin 9 to LED (Heartbeat)
Pin 8 to LED (Error)
Pin 7 to LED (Programming)

There are no other connections to the ATTiny (Two pins, 2 and 3 not connected).  I checked that power is running to the VCC pin (Pin 8ATTiny) by using an LED.  All of the above connections were just re-checked.

I have a spare ATMega328 and I'm willing to try burning that.  It shipped with an Arduino Bootloader.  I haven't played with that yet.  I don't have the Hardware file for it.  I'd try it myself, but I don't want to muddy the waters.

I do have the second Arduino Uno sitting here on my desk.  I've tried that and gotten the same results.
I have a Dragon AVR programmer here as well.  I couldn't get it to program the ATTiny either (I couldn't get it to read the Device ID of the ATTiny as well).  I don't know if I could use that to troubleshoot or not.

Static

OK, hold everything.

I have 5 ATTinys.

When I was trying to get the AVR Dragon up and running, I wound up pulling two of them out, in case I "zorched" one of them.  When both acted peculiar, I kept troubleshooting.  Late that night I came upon the method of using an Arduino to program ATTiny's.

I had nothing but problems.  Four different computers, two different Arduino Uno's, and two different ATTiny85's.  Everything acted the same way.

I just grabbed a brand new ATTiny and went through the whole process.  Blink appears to now be running on the ATTiny.  100% normal.

I just burned a "Constant On" program.  It is running 100% normal.

Finally, I just burned a program that turns Pin 0 on for 1 second, then turns it off and turns on Pin 1 for a second.  Functioning flawlessly.

I don't know what to tell other folks that are having the same problem, other than to skip the expensive AVR Dragon and stick with the Arduino that you know.

I'm going to play with it a bit more, and I'll post any results that I get or revelations.




Static

OK.  It's consistently working.  The first two ATTiny's that I worked with are write offs, as far as I know.  If I can ever get my AVR Dragon figured out, I'll try some HVSP.

I'm consistently able to get the first five pins (0-4) working as outputs.  I can't get the last one (the one that is the ATTiny reset pin) to work as a real output.  If I connect it, it is incredibly dim. 

Not an issue at all, right now. 

This works, and works GREAT!

Coding Badly

#51
Apr 22, 2012, 07:51 am Last Edit: Apr 22, 2012, 07:54 am by Coding Badly Reason: 1
OK.  It's consistently working.  


Excellent.  I'm glad you have it working.

Quote
The first two ATTiny's that I worked with are write offs, as far as I know.  If I can ever get my AVR Dragon figured out, I'll try some HVSP.


Bummer.  

There are two other things you can try: 1. smeezekitty has published a version of the ArduinoISP sketch that uses a very slow SPI clock.  If you accidentally set the fuses to a slow processor clock speed you may be able to recover using his sketch.

2. If you accidentally set the fuses to use an external crystal or resonator you can provide a clock signal on the XTAL1 pin to recover.  I believe LadyAda has published a version of the ArduinoISP sketch that provides a 1 MHz clock output suitable for such recovery.

But, your time is probably better spent getting HVSP working.

Quote
I'm consistently able to get the first five pins (0-4) working as outputs.


Excellent.

Quote
I can't get the last one (the one that is the ATTiny reset pin) to work as a real output.


The RESET pin will only function as an I/O pin after disabling reset (a fuse setting).  Once you disable reset you will only be able to reprogram the processor using HVSP.  Tread cautiously or you will brick another processor.

Quote
If I connect it, it is incredibly dim.  


That would be the internal pullup resistor providing a very tiny amount of current to your LED.

Static

I've got to run errands, but I'm going to post the behavior of my "failed" ATTiny's, just in case it helps someone else.

Go Up