Connecting an attiny 85 with a crystal occilator, how?

Hello, I'm trying to connect an external crystal or oscillator or however it's call to my attiny 85.
I connected a 40 mhz to the pins were the data sheet indicated but it did not made a difference. How do I know if it's working and do I need to indicate the chip by code to use the external clock?

Thanks

  1. You need to set the fuses to tell it to use the correct clock source.

  2. A 40hz clock is so slow that it could take minutes before it starts running your code - it's usually run at 8mhz, 200,000 times faster. Did you mean something faster than that?

  3. Note that fuse settings are different for external clock input (from a clock generator or other device that's outputting a clock) vs using a crystal.

Yes I meant 40 mhz.
And how do I indicate the chip to read that one?

The Attiny85 won't work properly (or at all) at 40 MHz. Look at its datasheet ( http://www.atmel.com/Images/Atmel-2586-AVR-8-bit-Microcontroller-ATtiny25-ATtiny45-ATtiny85_Datasheet.pdf ), page 163. Max speed is 20 MHz when supply voltage is > 4.5V.

To set up the fuse, you'll need an AVR programmer. Or, if you have an Arduino board, you can use it as an ISP : http://highlowtech.org/?p=1695 . The "burn bootloader" command will actually set up the fuses on the Attiny.