ATtiny85 timing issues

I am trying to program the ATtiny85 with a 16mhz external crystal using the Arduino-Tiny cores found here:
http://code.google.com/p/arduino-tiny/

My programmer is the Arduino Uno running the ArduinoISP sketch, and my IDE is v22.

When I select the ATtiny85@16mhz option, it programs the chip and then runs at 1/16 the speed of the 1mhz option. At that, the external crystal appears not to be doing anything (as I can remove it from the circuit and the program still slowly chugs along)

The ATtiny85@8mhz option appears to be running at 1/8 the speed.

The 1mhz option appears to be running at around the right speed.

I am basing this estimation on two things:

  1. The delay time in the blink example (it is roughly 1 second at 1mhz, 8 seconds at 8mhz and 16 seconds at 16mhz)
  2. Serial.println works at 1mhz and sends gibberish at any of the other clock speed.

I feel like there is something fundamental that I am missing here. Any help would be appreciated.

Like several Atmel MCUs, the ATtiny85 comes from the factory set to run on the 8MHz internal oscillator divided by 8, so 1MHz, which is consistent with your observations. The fuses need to be set to use an external crystal. See the datasheet, but setting the Low Fuse Byte to 0xFF should work for you.

The boards.txt file associated with the core appears to already be doing that as far as I can tell:

attiny85at16.name=ATtiny85 @ 16 MHz  (external crystal; 4.3 V BOD)

# The following do NOT work...
# attiny85at16.upload.using=avrispv2
# attiny85at16.upload.using=Pololu USB AVR Programmer

# The following DO work (pick one)...
attiny85at16.upload.using=arduino:arduinoisp
# attiny85at16.upload.protocol=avrispv2
# attiny85at16.upload.using=pololu

attiny85at16.upload.maximum_size=8192

# Ext. Crystal Osc.; Frequency 8.0- MHz; Start-up time PWRDWN/RESET: 16K CK/14 CK + 65 ms; [CKSEL=1111 SUT=11]
# Brown-out detection level at VCC=4.3 V; [BODLEVEL=100]
# Preserve EEPROM memory through the Chip Erase cycle; [EESAVE=0]
# Serial program downloading (SPI) enabled; [SPIEN=0]

attiny85at16.bootloader.low_fuses=0xFF
attiny85at16.bootloader.high_fuses=0xD4
attiny85at16.bootloader.extended_fuses=0xFF
attiny85at16.bootloader.path=empty
attiny85at16.bootloader.file=empty85at16.hex

attiny85at16.bootloader.unlock_bits=0xFF
attiny85at16.bootloader.lock_bits=0xFF

attiny85at16.build.mcu=attiny85
attiny85at16.build.f_cpu=16000000L
attiny85at16.build.core=tiny

This is the point I am particularly confused about.

After selecting the correct "board", Tools / Burn Bootloader will change the fuses.

I am getting the following error:

avr_read(): error reading address 0x0000
read operation not supported for memory "lock"
avrdude: failed to read all of lock memory, rc=-2

I tried some of the suggestions on this thread:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1274820597/90

I then updated my software and tried a new ATtiny85 in hopes it would go away, but I'm still getting the error. Any idea what is causing it?

You did this?
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1274820597/99#99

Yes, but I then get this error:

avrdude: stk500_recv(): programmer is not responding

Problem solved. The avrdude.conf mod ultimately worked.

The most recent version (Arduino 1) does not seem to support the ATtiny cores are far as I can tell.

Rolled back the software a few versions and all was resolved.

How did you solve the problem?

A different set of libraries ( https://github.com/damellis/attiny/tree/Arduino1 ) works fine with Arduino IDE 1.0 and also has ATtiny85

l1q1d:
How did you solve the problem?

I updated the Tiny Core to no longer include the lock-bit entries in boards.txt. A reinstall should get you past the problem.

@ CodingBadly

what is the difference between:

http://code.google.com/p/arduino-tiny/

and

https://github.com/damellis/attiny/tree/Arduino1

other than one works with 1.0 and the other doesn't.
Are they different versions of the same basic core?

lemming:
other than one works with 1.0 and the other doesn't.

Why do you say that?