AVR 8 Pin 20MHz 8K 4A/D - ATtiny85

Atmel's itty-bitty ATtiny85 8-Bit Processor. 8K of program space, 6 I/O lines, and 4-channel 10 bit ADC. Runs up to 20MHz with external crystal. Package can be programmed in circuit.

AVR 8 Pin 20MHz 8K 4A/D - ATtiny85 Product Help and Resources

How to Install an ATtiny Bootloader With Virtual USB

February 14, 2017

With this, you will be able to upload Arduino sketches directly to the ATtiny84 over USB without needing to use a programming device (such as another Arduino or FTDI chip).

Tiny AVR Programmer Hookup Guide

October 28, 2013

A how-to on the Tiny AVR Programmer. How to install drivers, hook it up, and program your favorite Tiny AVRs using AVRDUDE!

Core Skill: Soldering

This skill defines how difficult the soldering is on a particular product. It might be a couple simple solder joints, or require special reflow tools.

2 Soldering

Skill Level: Rookie - The number of pins increases, and you will have to determine polarity of components and some of the components might be a bit trickier or close together. You might need solder wick or flux.
See all skill levels


Core Skill: Programming

If a board needs code or communicates somehow, you're going to need to know how to program or interface with it. The programming skill is all about communication and code.

2 Programming

Skill Level: Rookie - You will need a better fundamental understand of what code is, and how it works. You will be using beginner-level software and development tools like Arduino. You will be dealing directly with code, but numerous examples and libraries are available. Sensors or shields will communicate with serial or TTL.
See all skill levels


Core Skill: Electrical Prototyping

If it requires power, you need to know how much, what all the pins do, and how to hook it up. You may need to reference datasheets, schematics, and know the ins and outs of electronics.

2 Electrical Prototyping

Skill Level: Rookie - You may be required to know a bit more about the component, such as orientation, or how to hook it up, in addition to power requirements. You will need to understand polarized components.
See all skill levels


Comments

Looking for answers to technical questions?

We welcome your comments and suggestions below. However, if you are looking for solutions to technical questions please see our Technical Assistance page.

  • Member #764667 / about 6 years ago / 1

    quick question. i clicked on the "product card" link and it took me to the atmel website. there are a lot of ordering codes on the atmel website for i guess different options of this product? which one are we getting exactly? i understand the clock frequecy is 20MHz so i can kinda guess that we are getting one with 20 in it but what does the other stuff mean? what are the differences? can they all be programmed the same using the tiny AVR programmer? just trying to understand this more... curious college student LOL thanks

    • M-Short / about 6 years ago / 2

      The actual manufacture part number is ATTINY85-20PU . It always tends to look like a lot of part numbers, but often it boils down to tape and reel vs tray, temperature ratings, and packaging. Sometimes you will even get different part numbers based on the default configuration (running at the full 20MHz, running at 1/2 clock speed at 10MHz, or using an external crystal for example), even though the actual chip is the same. For their naming convention usually you can find that in the ordering information at the bottom of the datasheet.

  • Drone / about 13 years ago / 7

    Finally the 85 appears. SparkFun is in the U.S., so I'm guessing PIC fan boys. AVRs not on the brain. - I'd like to see an ATtiny parts kit including ATtiny85, 20MHz crystal, crystal caps, bypass cap, and maybe a six pin ISP header. Even if these parts aren't kitted the related products list below should include them. Nope, now I gotta go hunting; or maybe that's the idea :-(

    • tantivy / about 10 years ago / 2

      Google Digispark.. currently on Kickstarter (until 9/9/12)

      ATtiny85 w/arduino bootloader, 500ma voltage reg, and usb plug, on a quarter sized board (0.69x0.75(17.5x19mm)-usb) I don't see a crystal, so I assume they are using the internal clock. Some shields are also available.

      • sorphin / about 10 years ago / 1

        They can't use a crystal because they use the USB (both use pins 2 and 3).. So some of what i'd have used them for.. I can't due to the lack of crystal capability. (believe me.. you realize just how out of spec the internal oscillator/pll are, when you're trying to hit an exact output frequency, and it's far enough out of spec that what you're talking to, ignores you.

      • MostThingsWeb / about 10 years ago / 1

        Those are neat. Hopefully SparkFun will carry them.

  • Lord Nothing / about 12 years ago / 4

    nice little chip. im still not sure what to use it for. probably could use it as some kind of servo channel mixer, or anywhere where i need to convert one type of a signal into another. shortage of pins kinda limits the possibilities.
    i really wish sf would stock the tiny84 though, which has twice the usable pins, yet still being small enough for those tiny projects. sometimes i use a mega328 and consider it a waste of functionality and the 2313 has too little flash. but the tiny84 would be a perfect addition to the inventory. especially since i have had a hard time finding a supplier which would ship to ak at a sane rate.

    • Kuy / about 10 years ago * / 1

      You might have to bite the bullet and order 25 from Digi-Key to justify shipping. You will no doubt think of projects to build with them!

  • PresidentOfAwesomeness / about 12 years ago / 4

    Any chance of you guys at Sparkfun selling this with the bootloader?

  • 17171717 / about 11 years ago / 3

    Does anyone know how much current you can source from the output pins? I couldn't find it in the datasheet.

    • baum / about 11 years ago / 2

      It's in there. You're looking for electrical characteristics, pg. 166:

      DC Current per I/O Pin ............................................... 40.0 mA

      DC Current VCC and GND Pins................................ 200.0 mA

      So 40mA per pin, and 200mA maximum draw for the whole chip... note that you have 6 GPIOs, if you draw the 40mA from each pin, you'll blow it... (6*40 = 240mA)

  • mrwillcreates / about 9 years ago / 2

    I use these for any Arduino project that I am making that does not require more than 6 I/O pins.

    PROS: can be used with a breadboard can be programmed with the Arduino software only $2.84! (compared to the $30 Arduino Uno)

    CONS: only 6 I/O pins difficult to remove once it has been used in a circuit board...

  • ironyeti / about 11 years ago / 2

    I just confirmed that the ArduinoISP can be used to program the SMD SMT version of the ATTiny85 chip. I used the Arduino 0022 IDE and board definitions and older version of the instructions from MIT High Low Tech. (The updated instructions for Arduino 1.0 fail for me.)

  • MimoBot / about 8 years ago / 1

    Anyone know of where I can get an SMD version of this chip? DigiKey maybe?

  • Alfredomova / about 8 years ago / 1

    I'm trying to control a strip of a single Neopixel with an Attiny85 @ 16Mhz (internal PLL, 4.3 V BOD) but it just doesn't work. the example "strandtest" just makes the led stuck in green, any help? i'm just connecting the data cable of the neopixel to the Pin 7 (PB2) in the Attiny, i also try putting a resistor in this, but it doesn't help.

                   ATTINY85
               _____________
               | RST      VCC | ---- 5v          (330ohms)                  grn----- | GND
               | PB3       PB2 | ---------------------ww----------------------- | DI             NEOPIXEL
               | PB4       PB1 |                                                         5v----- | 5V
    

    grn---- | GRN PB0 | _____________

  • benvyates / about 9 years ago / 1

    Since the MIT HLT lab site is no longer around, and all guides point to that, does anyone know where I can get the core files for this chip? I'm looking to use arduinoISP with this.

    • Zio / about 8 years ago / 1

      Check out TCWorld's Attiny cores. He has SPI, I2C, and (soft)serial functioning. He also has a stripped down optiboot boot loader that tunes the oscillator and allow you to upload sketches over serial (allowing you to regain the reset pin as an extra I/O!). I tried a lot of cores and these are my favorite.

    • lnventor / about 9 years ago / 1

      It's still up... http://highlowtech.org/?cat=20

  • Can these be set to operate at 8 Mhz instead of 20?

    • NathanTestEdu / about 9 years ago / 1

      Yep! The ATtiny85 ships with a fuse that makes them operate at internal 1MHz. That fuse can be changed to operate at 8MHz internal. If you need to go above that (or need better precision than the internal oscillator) you can set the fuses to operate with an external oscillator. 20MHz is the maximum external oscillator allowed.

  • Member #469568 / about 9 years ago / 1

    I'm not sure why but, I can't seem to find the output voltage per I/O pin, not including reset... can anyone help with this?

    • Kamiquasi / about 9 years ago / 1
      1. Check out the datasheet
      2. Find the Electrical Characteristics pages. ( Chapter 21, page 161)
      3. Read through the table for the information you're looking for :)
      4. In this case, with Vcc at 5V, the maximum low level is 0.6V, and the minimum high level is 4.3V.

  • Member #466054 / about 9 years ago / 1

    Is this component available in India, Mumbai

  • Cryocrat / about 9 years ago / 1

    So how many of these would I need to chain together to use as a Minecraft server...?

  • Member #420735 / about 9 years ago / 1

    does anyone know how to set the reset pin as I/O when using an arduino as ISP? im a noob so i need step by step instructions lol

  • Member #420735 / about 9 years ago / 1

    So does this actually have 6 I/O pins when you get it or do you have to reconfigure the reset pin or something?

    • Kamiquasi / about 9 years ago / 2

      You have to reconfigure the reset pin, so make sure you program it as desired in one go - or have a fuse bit restore circuit handy :)

      • Member #420735 / about 9 years ago / 1

        Where can i get a High Voltage Programmer to restore the fuse?

        • Kamiquasi / about 9 years ago / 1

          I honestly wouldn't know - I've never needed one :) If you need more I/O it might be worth it to go for the models that offer that without shenanigans.
          A quick googling about shows that you can get a dev kit from ATmel that'll do HV programming (STK500), you can build your own (quite a few designs out there, mostly based on the dev kit), or you can eat the cost of the ATtiny and contribute to the landfills by tossing it and just programming another one (a popular option, apparently, but what a waste).

  • Member #168928 / about 10 years ago / 1

    Hi all. Anyone know if it's possible to use with a nordic radio? Is there any serial pirt on it?

  • trandi / about 10 years ago / 1

    Here's a nice project with the previous version of this chip (AtTiny13) that shows how versatile and easty to work it is !

    It basically uses 3 different interrupts plus ADC (the attiny13 only has 1 ) and a simple digital output !

    Dan

  • Member #374026 / about 10 years ago / 1

    I got this chip recently, and here is a short note on programming it with the Sparkfun AVR Pocket Programmer:

    http://tat-tvam-asi.in/hacking/programming-atmel-attiny85-with-the-sparkfun-pocket-programmer/

    • lnventor / about 9 years ago / 1

      Site flagged as a Blackhat SEO Exploit by AVG. Do not click.

      • Kamiquasi / about 9 years ago / 1

        Looks like AVG is mostly tripping over a bunch of spam that's in a normally-hidden DIV. While it raises questions of how that spam got there, I think it would be safe to click - especially with scripting etc. disabled, or right-click, save as, and open the file as text in e.g. notepad, as it's mostly text instructions.

  • signal7 / about 10 years ago / 1

    Link to product card not working - at least not in chrome...

  • dewclaws / about 10 years ago / 1

    I bet I'll get slapped for this, but I'll ask anyway. I am looking for suggestions on what power regulator I should use for this little guy when powering it from a 9v battery? I was thinking of using a Low Dropout Regulator 5 Volt 0.05A 3-Pin TO-92 Box from Jamco but I dont know if that little package will provide the correct output ourrent.

    (see: http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&storeId=10001&catalogId=10001&pa=107166&productId=107166&keyCode=WSF&CID=GOOG&gclid=CI2TocLm6rICFexAMgodOU0ALQ for the

  • Member #132481 / about 10 years ago / 1

    I'm looking to build a rather complicated alarm clock for a friend's birthday, and I figured I could use one of these to dramatically simplify the design, my only question is,

    How accurate is the internal resonator in these things? I've read that I can use an external crystal, and SparkFun sells them at +/- 50ppm stability, can I match that with the internal resonator?

  • I built a programmer for it, using the arduino proto shield. Makes my life a lot easier.

  • prismspecs / about 10 years ago / 1

    Does this have 3 PWM outputs?

  • boj / about 10 years ago / 1

    This post says this can be clocked at up to 20 Mhz. Could I clock this at 16 to not screw up timing with my Arduino code?

    • Kuy / about 10 years ago / 2

      Yes, you can run it at 16MHz. With avr-gcc and avr-libc (which Arduino is based on) clock speed is controlled by a preprocessor definition (F_CPU) - change it and your timing will be right.

  • BostonBrap / about 11 years ago * / 1

    Hi all! I've recently bought two of these Attiny85 chips. I followed the MIT hi-low tech-group instructions on using Arduino as an ISP to program the chips.

    http://hlt.media.mit.edu/?p=1229

    I uploaded the ISP example sketch first, worked fine. After trying to upload 'blink' thought I got these errors:

    avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x64

    avrdude: failed to write flash memory, rc=-4

    avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

    I've triple checked my connections and poked around online for about three hours last night to no avail .. One common theory seems to be that the Attinys bootloader is fried/not the correct one. I'm stumped.

    Does anyone have any insight?

    • ironyeti / about 11 years ago / 1

      I had trouble with the Arduino IDE 1.0

      I reverted to the old Arduino 0022 instructions and board definitions and everything worked again. I think the new instructions are just incomplete or something.

  • SponjWorthy / about 11 years ago / 1

    Any chance of getting this to talk to another AT using i2c? My problem is my program is already very close to 8k so I'm thinking all the code to fake a UART or i2c may cause me to run out of space...

    • baum / about 11 years ago / 1

      There is I2C on this chip... But it's in the form of a "USI:" Universal Serial Interface. Check out the DS, but I think it's sort of like a shift register to facilitate SPI and I2C communication. But you would still need to implement the protocol...

      check this out: http://code.google.com/p/arduino-tiny/wiki/TWIMasterLibrary

      (both master and slave libs avail.) not sure how much space it takes up, but it's worth a shot...

      On the program side: if you have a lot of variables/strings/constants that you are working with, and you're going to set up I2C, why not get an i2C EEPROM from SFE to store that? Could take down program size...

  • baum / about 11 years ago / 1

    'Please, sir,' replied Oliver, 'I want some more [ATtiny85s].'

  • LittleBlinkyThing / about 11 years ago * / 1

    Do these have analog imputs? And if so, how many?

    • baum / about 11 years ago / 1

      They have 4 10-bit ADCs. Take a look at the DS for more info.

      • LittleBlinkyThing / about 11 years ago * / 1

        So I could have 3 PWM channels and 3 analog imputs?

        • fungus / about 10 years ago / 1

          You can use all six pins but once you reconfigure the 'reset' pin as I/O you can't update the software without a special programmer.

        • baum / about 11 years ago / 1

          PWM ≠ ADC.

          You get 4 PWM pins and 4 ADCs, but they are not related in ANY way. Look @ the DS.

  • SkylerZio / about 11 years ago / 1

    So, as I understand, one can program this, correct? What do I need to do that?

    • orthomal / about 11 years ago / 1

      You'll need a programmer like the this and some sort of AVR programming toolchain. Google programming avr or attiny and that should give you a start, but as of right now there's no one best resource. There's an incomplete tutorial on the adafruit website that is probably the best start, but you'll have to do some searching on your own to fill in the blanks.

  • Hivoltage / about 11 years ago / 1

    Link to Datasheet changed
    http://www.atmel.com/dyn/resources/prod_documents/doc2586.pdf

  • WilliamK / about 11 years ago / 1

    It has 2 pins for an external crystal, (up to 20Mhz) or you can use its 8Mhz internal one. Notice that this is not Arduino compatible out-of-the-box, you will need to get some files to make it work, but once you do that, its just very easy to setup. We have done a small project using one of those chips and it just works great. Check our GitHub files for the required files and how to setup the whole thing up.
    https://github.com/Beat707/Beat707-BigTime

  • What is the frequency of the internal oscillator?

    • Kuy / about 11 years ago * / 1

      You can set the CKSEL fuse bits to run at 16MHz from the internal oscillator. See page 27 of the datasheet.

    • Lord Nothing / about 12 years ago / 1

      i clocked mine to 8mhz on the internal oscillator. but you could run it up to 20mhz with an external crystal (at least thats what i read in the datasheet).

  • inthebox / about 12 years ago / 1

    I see no dedicated pins for a crystal so does it require one? If it doesn't require an external crystal do I have to do any configuring to get it to work? (I'm putting the arduino bootloader on it.)

    • fungus / about 10 years ago / 1

      You can use one but you lose one of the I/O pins. It can run up to 16Mhz without one so there's no real advantage to an external crystal.

    • baum / about 11 years ago / 1

      It can have a crystal. Look at the XTAL pins.

  • SlyVixsky / about 12 years ago / 1

    I'm goinna drag up the boot loader idea posted above :) im additiom to a few arduino boards, i also have the "teensy HID" which uses an atmel chip, and runs on the halfkay bootloader. very nice little program, easy to use, and the teensy can run everything the arduino can. might not hurt to offer the '85 with halfkay installed

  • sethborders / about 12 years ago / 1

    Does this chip have UART?

    • Kuy / about 12 years ago / 1

      No, but you can fake it by shifting bytes out with the USI peripheral and precise timing (driving the USI with a hardware timer is one option.) Note that you will have to flip the bits of the byte you wish to send or receive. This technique is tricky - see Atmel App Note AVR307 for details.
      If you want a cheap and simple AVR chip with UART, get the Tiny2313. It only has 2K of Flash, so keep your code simple. If that's too limiting, go for the venerable Mega48 or '88, which cost the same or less than this chip. The Mega328 is pin-compatible with the '48 and '88 and SparkFun sells it.

      • ATtiny Fan / about 11 years ago / 1

        The main reason people use ATtinys is because they are small, giving the example of the 48/88 doesn't help those of use that use Attinys for their small size and ease of use.

        • Kuy / about 10 years ago / 1

          The small size argument is kind of moot because a surface-mount (e.g. TQFP) ATMega328, which is entirely solderable by hobbyists, is a fraction of the size of even this 8-pin DIP chip. The main reason people (and by this I mean professionals) use ATtinys is because they're cheap - a tiny25 is about 60 cents in bulk and can still do lots of powerful stuff!

      • baum / about 11 years ago / 1

        Or the 4313. Same chip w/ twice the space.

  • Cean / about 12 years ago / 1

    Is this the ATtiny85 or ATtiny85v? The datasheet says the ATtiny85v will run at 1.8v but the ATtiny85 will only run at a minimum of 2.7v.

    • Alex111 / about 12 years ago / 1

      I think it has to be the non V version as on the data sheet on the first page says only the non V version can go to 20MHz.

  • D4rK / about 12 years ago / 1

    Can this processor output PWM? Can the arduino bootloader be put onto it? I really need a cheap alternative to the ATmega328 ad I hope this is it.

    • Kuy / about 12 years ago / 1

      A cheap and excellent alternative to the 328 is a Mega48. It has 4KB of code space, 512 bytes of RAM and 256 bytes of EEPROM. It's totally pin- and code-compatible with the old Arduino chip (the '168) and has all the peripheral features you need with none of the trade-offs that the Tinys make:
      * AVR Megas have hardware UART, I2C and SPI interfaces - Tinys have to emulate these with the USI (a specialized hardware shift register.)
      * Megas have a multiply instruction - Tinys have to emulate this in software too.
      SparkFun has no reason to stock a lesser version of the '328 but you can get them at prices approaching US$1.50 each at Digi-Key and other big suppliers.
      That said, the Tiny25/45/85 have a special feature that the Mega48-328 don't, which is a programmable PLL that lets them run the PWM clock at a whopping 64MHz (undivided, check datasheet for specifics) and they can run the CPU clock from the PLL too, netting the ability to run at > 16MHz with no external oscillator!

    • ThinkerT / about 12 years ago / 1

      Yeah, you can put the bootloader on it. See the link below. It is a slightly different version but you can still use the same commands.

    • Yeah it can output PWM, on multiple channels. (these or attiny45's are what power the BlinkM RGB modules)
      I'm not sure if you can get the bootloader on them, but they have enough space for it.
      I broke down and got a USBtiny ISP programmer, but you can program with an Arduino board if you have one. Here's some info I was looking into regarding that:
      http://hlt.media.mit.edu/wiki/pmwiki.php?n=Main.ArduinoATtiny4585

      • gdahilig / about 11 years ago / 1

        Updated link: http://hlt.media.mit.edu/?p=1229 Updated link with for the Arduino 1.0.: http://hlt.media.mit.edu/?p=1695

        Great info here. I'm new to Arduino and was starting to realize that each Arduino project will require an Arduino ($$$). It's nice to know that once I've got my project going I can dump it (i.e. shoehorn) onto something a much cheaper chip. Thanks all.

  • Ritch / about 13 years ago / 1

    Im hoping to create an ATtiny programmer as well as use two of them for a key lock mechanism thingy. Just want to check the voltage operation from the datasheet. It will work at anything between 1.8V and 5.5V?
    I'm going to be running a larger battery on one for long time but watch batteries for the other.

    • Earlz / about 12 years ago / 1

      yes, the ATTinys are quite flexible with power. For good (and safe) measure though, I would pair it with a suitable voltage regulator..

  • BurnerJeremy / about 13 years ago / 1

    Just a heads up for those using this part, you'll want to make your own component in Eagle. The ATTiny45 in the SFEagle library has the pin assignments mixed up (as of 09-15-2009).

    • Praetorian / about 13 years ago / 2

      As a workaround you might use the ATTINY13 (seems to have the same pinout as the ATTINY25/45/85 and the DIP package is available).

      • TWMIV / about 13 years ago / 1

        I just made a new part in eagle. As long as you can find an identical package it is very easy to do.

Customer Reviews

5 out of 5

Based on 8 ratings:

Currently viewing all customer reviews.

1 of 1 found this helpful:

Certainly the best size to efficiency ratio for such a chip!

I have many projects which I was originally intending to be run by an Arduino. The problem: these projects use very few I/O pins/program space and even the smallest/cheapest Arduino boards (i looked at cheap chinese knockoffs of the Arduino mini) are too big and expensive. This chip has perfectly fit my needs!

2 of 2 found this helpful:

the cutest mcu you will ever find

just look at it; sitting there next to that giant quarter. being all...programmable...and stuff. AVR programmer required. Other than that, it'll do simple tasks on the cheap.

When you need it small

A problem with many microcontrollers are that they are big. they have too many i/o pins and features while in reality all you may want to do is simply control a few things. It is a waste.

This ATtiny however is as the name suggests tiny. it is meant for small projects and cases where space is a premium. perfect for small projects where you just need it to blink a few leds and such

My latest project involving a ATtiny is a tiny robotic line-follower using a few sensors and 2 tiny motors. Im making the design in the theme of a mouse

Best thing I ever owned!

I'm using this s an i2c slave for a home made rotary encoder. So far so good! It was a breeze to prototype when used with another "Arduino as ISP". Very happy that I had one on hand, and surprised at how robust it seems. Can't wait to find more uses for this tiny thing.

Best combination of cost, size, space, power & cuteness

When you need low footprint, cost effective Prototyping on mini breadboard or need to build a project with one or two sensors/LEDs/loads @Tiny 85 is the best. 8k is not low enough space for programming, using SPI/I2C, LCD/7 Seg display can be interfered. With one ADC channel, multiple switches can be interfered too. 8k is enough to hold codes for doing these things. No worries !!

Best little MCU I've used to date

I used this MCU in a project to mimic a device in Left 4 Dead/Left 4 Dead 2 for a Zombie Crawl.

Worked like a charm, and using the AVR Programmer made it easy.

Awesome little fella!

Excellent product. I intend to use it to make an I2C based stepper motor drive controller. Using this I2C implementation: https://github.com/SpenceKonde/ATTinyCore

Best thing to discover a hiden world

there is a hiden world beside the arduino main stream, you can personalise it ! A BIT hard for begginners trough... I love it !