Atmel put out some new, small microcontroller chips early this year, and we’re just now starting to think about how we’d use them. The ATtiny102 and ATtiny104 (datasheet) sell for about a buck (US) and come in manageable SOIC packages with eight and fourteen pins respectively. It’s a strange chip though, with capabilities that fit somewhere between the grain-of-rice-sized ATtiny10 and the hacker-staple ATtiny25-45-85 series.
The ATtiny104 has a bunch of pins for not much money. It’s got a real hardware USART, which none of the other low-end AVRs do, and it’s capable of SPI in master mode. It has only one counter, but it’s a 16-bit counter, and it’s got the full AVR 10-bit ADC instead of the ATtiny10’s limited 8-bit ADC. The biggest limitation, that it shares with the ATtiny10, is that it has only 1 KB of program flash memory and 32 bytes (!) of RAM. You’re probably going to want to program this beast in assembler.
Read on for more reviews, and check out [kodera2t]’s video review at the end.
Reviews
The first review comes courtesy of [Dan Watson] on his blog. He bought one of the Atmel Xplained 104 Nano evaluation boards back in March and put it through its paces. We don’t know how he got one for under $5 back then, but the kit seems available for under $10 from the usual suspects.
The Xplained kit is funny. It’s got a relatively powerful ATmega32u4 serving as an in-system programmer and USB-serial connector for the Tiny part. That’s funny because the programmer costs twice as much as the device under test.
[Dan] also presents a nice comparison chart of the small AVR parts. (Click to embiggen.)
[kodera2t] has been pushing the ATtiny series of chips to the max for a few months now, so we were stoked to see his review of the ATtiny102. Given the chip designation (T102-ES), he managed to get himself some engineering samples, which is extra cool-points, but shouldn’t discourage you because the parts are in stores now.
Instead of working with an evaluation board, [kodera2t] did everything from scratch. Maybe that’s why he emphasizes the new pinouts of the ATtiny102 parts. In particular, the GND pin is where the VCC pin is located on other ATtiny chips(!). It pays to read the datasheets. Although we’re grumpy and hate change, the new pinout is much more rational, with the VCC and GND pins together at the top of the chip, right where you want to add a decoupling capacitor anyway.
There’s one other minor gotcha if you’re used to working with the ATtiny parts. Because the ATtiny104 has fourteen pins, the GPIOs are split into two eight-bit banks: PORTA and PORTB. The ATtiny102 seems to be a chopped-down version of the 104, which means that even though it only has six GPIO pins, they’re still spread out across the two banks — three pins in each. If you’re accustomed to writing whole bytes at a time to GPIO output, this’ll force you to change your coding habits.
Uses
We find ourselves scratching our heads and asking what this chip is good for. The USART in a small and cheap package is a great feature. Something like the ATtiny14, with eleven or twelve free GPIO pins, fits a nice niche for very small projects. But we can’t quite get our heads around the 32 bytes of RAM. Whatever applications there are for the USART will have to reckon with a short receive buffer, for instance, and do its processing on the fly. C startup code alone costs a few hundred bytes, and with such limited RAM, we are guessing that coding assembler is the only reasonable option.
Of course, the hacker market was probably not even on Atmel’s radar when designing and marketing this chip. It must be good for some industrial use that we can’t quite figure out. What needs USART but doesn’t need much program or RAM? What uses can you think up for such a niche device?
Filed under:
ATtiny Hacks,
Hackaday Columns,
Microcontrollers