Issues with attiny 85 and 32 KHZ clock crystal

I am having some difficulties with using a 32 khz clock crystal with an attiny85. I watched insidegadget's youtube video, and per his instructions, I set up a dedicated board entity whiten the High-low tech boards file. I changed the fuses to what was used in the video, then restarted the IDE. After everything was connected correctly, I tested by setup by blinking an led. My custom board item shows up, I can use it to program the attiny85, but when I blink an LED, it blinks at the usual, slow 8mhz internal oscillator speed. I can even remove the clock crystal from the setup and the blink sketch will still work in it's state. I am connecting the crystal directly to the xtal pins. I do not know why it is working, but not working properly. I'm guessing it has something to do with the boards file, but I am unsure of this. Please help! I am using the programming connections in MIT's high low tech tutorial, and am working with a R3 DIP arduino uno in 1.0.5.

Did you do "Burn bootloader"?

I think you are missing the point, you don't need to burn the boot loader on an attiny85. You just upload the code, i think. The boot loader is only for micros that support serial programming, the attiny does not.

qquuiinn:
I think you are missing the point

Nope.

qquuiinn:
you don't need to burn the boot loader on an attiny85. You just upload the code, i think. The boot loader is only for micros that support serial programming, the attiny does not.

"Burn bootloader" also sets the chip's fuses (eg. to use a different clock source)

Also bear in mind that uploading will have to be done at 32/6 = 5.3 kHz.

Did you read Datasheet? You can use ONLY 16MHz Crystal oscillator.

0xN35T:
Did you read Datasheet?

Did you? My copy has a whole section on how to use a 32768Hz watch crystal with a Tiny85.

0xN35T:
Did you read Datasheet? You can use ONLY 16MHz Crystal oscillator.

Utter nonsense. See Page 164:

Thanks for the advice, was finally able to burn the bootloader...and successfully bricked my '85 in the process. This is due to the fact that arduino as ISP is terrible at burning fuses. Will get some more chips and a real programmer soon.

Did you modify the ArduinoISP sketch as I suggested in Reply #4?

Possibly... :smiley:
Next time I will be less hasty, however I don't see why programming speed could affect fuse settings, even if the IDE said the burn was successful.

You have it backwards. The fuse settings (clock setting) affect the speed at which your programmer (an Arduino running the ArduinoISP sketch) can communicate with the target (your ATtiny85 processor). In your case, if you fail to lower the communications speed the target will not respond; it will appear to be bricked.

...even if the IDE said the burn was successful.

Fuse changes take effect after the target has been reset. From the factory you will be able to change the target's clock setting to 32.768 kHz clock crystal using the ArduinoISP sketch. If that step goes well, after the target has been reset (after avrdude has finished changing the fuses) the target will be running at 32.768 kHz. Until you modify the ArduinoISP sketch you will no longer be able to communicate with the target.

Sorry . Not only 16MHz.
Read here:

--or here--
http://sk.mouser.com/ProductDetail/Atmel/ATtiny85-20PU/?qs=sGAEpiMZZMtkfMPOFRTOl5CRAVRAdtfp
Clock frequency: 20MHz

That is the maximum clock frequency for that part. Atmel sells two versions of the ATtiny85. A low voltage version with a maximum clock frequency of 10 MHz and a "normal" version with a maximum clock frequency of 20 MHz.

If you had looked at the datasheet snippet Tom Carpenter graciously posted in Reply #7 you would have seen that the Clock Frequency can vary from 0 MHz to 20 MHz.

32KHz watch crystal on ATtiny85 for 1 pps output
http://www.insidegadgets.com/2011/10/08/how-to-use-a-32khz-watch-crystal-on-an-attiny85/

Fuses:
-U lfuse:w:0xe6:m
-U hfuse:w:0xdf:m
-U efuse:w:0xff:m

> avrdude -c arduino -p Attiny85 -P com15 -b 19200 -U flash:w:main.hex -U lfuse:w:0xe6:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m

avrdude: please define PAGEL and BS2 signals in the configuration file for part
ATtiny85
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e930b
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed

         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: please define PAGEL and BS2 signals in the configuration file for part
ATtiny85
avrdude: reading input file "main.hex"
avrdude: input file main.hex auto detected as Intel Hex
avrdude: writing flash (188 bytes):

Writing | ################################################## | 100% 0.22s

avrdude: 188 bytes of flash written
avrdude: verifying flash memory against main.hex:
avrdude: load data flash data from input file main.hex:
avrdude: input file main.hex auto detected as Intel Hex
avrdude: input file main.hex contains 188 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.17s

avrdude: verifying ...
avrdude: 188 bytes of flash verified
avrdude: reading input file "0xe6"
avrdude: writing lfuse (1 bytes):

Writing | ################################################## | 100% 0.03s

avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0xe6:
avrdude: load data lfuse data from input file 0xe6:
avrdude: input file 0xe6 contains 1 bytes
avrdude: reading on-chip lfuse data:

Reading | ################################################## | 100% 0.02s

avrdude: verifying ...
avrdude: 1 bytes of lfuse verified
avrdude: reading input file "0xdf"
avrdude: writing hfuse (1 bytes):

Writing | ################################################## | 100% 0.02s

avrdude: 1 bytes of hfuse written
avrdude: verifying hfuse memory against 0xdf:
avrdude: load data hfuse data from input file 0xdf:
avrdude: input file 0xdf contains 1 bytes
avrdude: reading on-chip hfuse data:

Reading | ################################################## | 100% 0.02s

avrdude: verifying ...
avrdude: 1 bytes of hfuse verified
avrdude: reading input file "0xff"
avrdude: writing efuse (1 bytes):

Writing | ################################################## | 100% 0.02s

avrdude: 1 bytes of efuse written
avrdude: verifying efuse memory against 0xff:
avrdude: load data efuse data from input file 0xff:
avrdude: input file 0xff contains 1 bytes
avrdude: reading on-chip efuse data:

Reading | ################################################## | 100% 0.03s

avrdude: verifying ...
avrdude: 1 bytes of efuse verified
avrdude: safemode: Fuses OK
avrdude done.  Thank you.
>

main.hex.txt (545 Bytes)