Go Down

Topic: Attiny85 20 MHz (Read 9473 times) previous topic - next topic

Coding Badly

#15
Dec 31, 2012, 07:55 am Last Edit: Dec 31, 2012, 10:05 pm by Coding Badly Reason: 1

There are three possibilities...

• If you are using an Uno (or other Arduino compatible board) as a programmer, auto-reset has not been disabled

• The wiring between the programmer (Uno) and the target (ATtiny processor) is not correct

• The target has been configured to use an external clock but a clock signal is not present on XTAL1

It is fairly easy to determine which is the culprit from a verbose output.  Enable verbose output for uploads and post the results.

kculm





It is fairly easy to determine which is the culprit from a verbose output.  Enable verbose output for uploads and post the results.



I am unfamiliar with verbose output, can you please explain. Thank you.

Coding Badly

#17
Dec 31, 2012, 08:11 am Last Edit: Dec 31, 2012, 08:13 am by Coding Badly Reason: 1

• Start the Arduino IDE

• Click File then Preferences

• Ensure Show verbose output during: upload is checked

• Click OK

• Try to Burn Bootloader (try to do whatever you were trying to do)

• Click in the Status Window (bottom part of the IDE)

• Hold Ctrl and press A to Select All

• Hold Ctrl and press C to Copy

• Paste into a reply; please use [code] [/code] tags

kculm

This is what I get when I try the burn boot loader  with the ATTiny85 (internal 8Mhz clock)

Code: [Select]
C:\arduino-1.0.1\hardware/tools/avr/bin/avrdude -CC:\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -pattiny85 -cstk500v1 -P\\.\COM4 -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:\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf"

         Using Port                    : \\.\COM4
         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.08s

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.


Coding Badly


Which eliminates the first possibility leaving...

• The wiring between the programmer (Uno) and the target (ATtiny processor) is not correct

• The target has been configured to use an external clock but a clock signal is not present on XTAL1

Very carefully check the wiring.

kculm

If this is the case, can I fix it or just trash it.



• The target has been configured to use an external clock but a clock signal is not present on XTAL1

Very carefully check the wiring.

kculm

#21
Dec 31, 2012, 10:36 pm Last Edit: Dec 31, 2012, 11:15 pm by kculm Reason: 1
I Tried it with a Brand new one, I still get errors when I try to do the boot loader and upload Blink.

But Blink works.

cjdelphi

#22
Jan 01, 2013, 08:50 am Last Edit: Jan 01, 2013, 08:52 am by cjdelphi Reason: 1
Wiring issue.

+
. . . .
. . . .
      -


pin 7 - pin 13 on an uno.
pin 6 - pin 12
pin 5 - pin 11
pin 1 - pin 10 (ss)

pin 8 = Positive/ 5v
pin 4 = 0v / GND


Upload the ISP sketch from Arduio (MKII / UNO) and upload the firmware, hit reset, forget the cap to gnd.

Now select Arduino as ISP, pick Attiny85 8mhz, now burn the bootloader.

Now you may proceed to program the chip with your code.



cjdelphi

the only exception to what i've said...

It's been burnt with a 20mhz bootloader, in which case you'll need to add a Crystal and Caps, or you wont be able to upload anything.

kculm

cjdelphi, Thank you for all your help.

Not to be a pain but I have a few questions for you.
when you say
Upload the ISP sketch from Arduio (MKII / UNO) and upload the firmware, hit reset, forget the cap to gnd.

I am not sure what you mean by up load firmware.

Also in Arduino 1.0.1, under tools programmer, it's all ready set to Arduino as ISP. is that correct?

And lastly, what core are you using. I have been told to download three different versions.

the one latest one I was told to use has the 85 Listed as AtTiny85(internal oscillator: BOD disabled)

Like I said I am sorry If I am being a pain. I am just trying to learn.


oliv3r

Hello all and sorry if i'm HI-Jacking this thread.

But I have a somewhat similar situation/question.

I also have an attiny85 and I also wanted to use an Arduino (Mega 2560) as an ISP programmer. This constantly failed to work so used a Buspirate instead to do a verify (e.g. avrdude -v). This outputted fuses and everything and I could burn the tiny empty85at8.hex (and verify) it a few times successfully. I'm not quite sure what this does (I belive it is the same as using the 'burn bootloader' option, which doesn't really burn any bootloader but sets up the fuses?

Anyhow, I've managed to compile nathan's IR -> Keyboard 'gateway' for the attiny85 and since I want to use a 12 MHz crystal (tinytuner was refusing to compile so I figured I might as well just use the oscillator for more accurate timings) I used as a board attiny85 with external osc from the boards menu.

I then compiled in the arduino IDE using 'verfiy' and went to /tmp/build1234.tmp/ to find the compiled hex file. I used avrdude to upload the file and verify (-U flash:v:file.hex) successfully. However after this all interaction with the attiny85 fails.

From the posts above I'm guessing this is expected, as now I need the 12 MHz crystal on pins 2/3 iirc (with caps) to even talk to the attiny? Is this correct? If just for testing purposes I quickly solder only the crystal to those pins, would it communicate again as well? (The board I made has the caps and crystal already on it but quickly hooking up a crystal is easy, adding the caps is trickier.

I guess to summarize, my question is, when selecting the board type from the menu, is this setting up any fuses and do those fuse settings end up in the final hex file? Or have I broken my chip somehow?

Oliver

dc42

#26
Jan 02, 2013, 05:09 pm Last Edit: Jan 02, 2013, 05:11 pm by dc42 Reason: 1

From the posts above I'm guessing this is expected, as now I need the 12 MHz crystal on pins 2/3 iirc (with caps) to even talk to the attiny? Is this correct? If just for testing purposes I quickly solder only the crystal to those pins, would it communicate again as well? (The board I made has the caps and crystal already on it but quickly hooking up a crystal is easy, adding the caps is trickier.


You only need the crystal if you programmed the fuses to expect a crystal as well. In this case, it will probably work without the capacitors. Alternatively, if you have an Arduino then write a sketch to toggle an output pin continuously, and feed that to pin 2 of the ATtiny.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

oliv3r

#27
Jan 02, 2013, 06:18 pm Last Edit: Jan 02, 2013, 09:31 pm by oliv3r Reason: 1
I was not aware that I had programmed any fuses in that regard. Toggling the pin on the arduino is handy :) But i have 30 crystals, so that's easy enough.

With a 12 MHz crystal everything burns and verifies perfectly fine again. Sorry for the noise ;)

Go Up