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.
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.
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
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.
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
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.
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
We welcome your comments and suggestions below. However, if you are looking for solutions to technical questions please see our Technical Assistance page.
Based on 8 ratings:
1 of 1 found this helpful:
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:
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.
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
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.
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 !!
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.
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
there is a hiden world beside the arduino main stream, you can personalise it ! A BIT hard for begginners trough... I love it !
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
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.
Thanks a lot for your time and response!
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 :-(
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.
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.
Those are neat. Hopefully SparkFun will carry them.
Like
+1 there are really nice ! Here's an example of how even the previous version (less ADCs, memory, etc. ...) is nice to work with...
Dan
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.
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!
Any chance of you guys at Sparkfun selling this with the bootloader?
Does anyone know how much current you can source from the output pins? I couldn't find it in the datasheet.
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)
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...
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.)
Anyone know of where I can get an SMD version of this chip? DigiKey maybe?
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.
grn---- | GRN PB0 | _____________
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.
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.
It's still up... http://highlowtech.org/?cat=20
Can these be set to operate at 8 Mhz instead of 20?
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.
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?
In this case, with Vcc at 5V, the maximum low level is 0.6V, and the minimum high level is 4.3V.
Is this component available in India, Mumbai
We ship to India, but you may also want to consider checking our our Distributors page for a more local shop.
So how many of these would I need to chain together to use as a Minecraft server...?
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
So does this actually have 6 I/O pins when you get it or do you have to reconfigure the reset pin or something?
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 :)
Where can i get a High Voltage Programmer to restore the fuse?
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).
Hi all. Anyone know if it's possible to use with a nordic radio? Is there any serial pirt on it?
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
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/
Site flagged as a Blackhat SEO Exploit by AVG. Do not click.
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.
Link to product card not working - at least not in chrome...
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
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.
Does this have 3 PWM outputs?
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?
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.
Thank you! Now I need one of these more!
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.
I uploaded the ISP example sketch first, worked fine. After trying to upload 'blink' thought I got these errors:
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?
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.
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...
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...
'Please, sir,' replied Oliver, 'I want some more [ATtiny85s].'
Do these have analog imputs? And if so, how many?
They have 4 10-bit ADCs. Take a look at the DS for more info.
So I could have 3 PWM channels and 3 analog imputs?
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.
PWM ≠ ADC.
You get 4 PWM pins and 4 ADCs, but they are not related in ANY way. Look @ the DS.
So, as I understand, one can program this, correct? What do I need to do that?
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.
Link to Datasheet changed
http://www.atmel.com/dyn/resources/prod_documents/doc2586.pdf
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?
You can set the CKSEL fuse bits to run at 16MHz from the internal oscillator. See page 27 of the datasheet.
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).
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.)
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.
It can have a crystal. Look at the XTAL pins.
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
Does this chip have UART?
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.
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.
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!
Or the 4313. Same chip w/ twice the space.
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.
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.
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.
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!
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
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.
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.
yes, the ATTinys are quite flexible with power. For good (and safe) measure though, I would pair it with a suitable voltage regulator..
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).
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).
I just made a new part in eagle. As long as you can find an identical package it is very easy to do.
They've fixed it now!