I'm looking to build a pretty basic project that relies on several submodules that use I2C for communication. I'm trying to find the smallest, cheapest AVR device that supports I2C. I know the 328P has a built in I2C interface, but I really don't need the 20 something other pins. Can anyone point me towards something more like an ATtiny that has a built in I2C interface?

My goal is the smallest, cheapest AVR without relying on software IC2 implementation.

  • \$\begingroup\$ Does using the USART on every AVR count as a "software implementation"? The U is, after all, for universal. \$\endgroup\$ – Phil Frost Apr 4 '13 at 2:22
  • \$\begingroup\$ I was hoping that there was something like 2 dedicated I2C pins, like on the 328p \$\endgroup\$ – K. Barresi Apr 4 '13 at 2:38
  • 1
    \$\begingroup\$ PIC24's are cheap (dollar or two in quantities of 1) and have a hardware I2C implementation and on board clocking. Some come in 14 pin packages Your project will not explode if your microcontroller isn't an AVR. \$\endgroup\$ – Kaz Apr 4 '13 at 7:38
  • \$\begingroup\$ Well if I'm going for the PIC24, I might as well just go for the ATMega328, since they're both $2.24 on Mouser \$\endgroup\$ – K. Barresi Apr 4 '13 at 13:36
  • \$\begingroup\$ In March, 2017 according to Mouser, Digikey, and Microchip product searches, the only small PDIP (8, 14 pins) MCUs with hardware I2C and UART are the PIC12's and PIC16's. They're generally about the same price or cheaper, faster (32MHz internal oscillator), and have more h/w features (some have more program flash and SRAM) than the other small PDIP AVRs, which are starting to look fairly long in the tooth. \$\endgroup\$ – Bogatyr Mar 26 '17 at 21:06

A quick parametric search on Digikey shows that the ATTiny20 is the cheapest AVR with dedicated I2C capabilities in one-off quantities. Note that the ATTiny20 only provides hardware slave support, master TWI/I2C still needs a software implementation.

A slight step up is the ATTiny25 which has both master and slave TWI/I2C support, but operating in master mode the clock generation I believe has to be generated in software.

For complete TWI/I2C support, take a look at the ATTiny48.

  • \$\begingroup\$ Apparently, slave-only if the datasheet is to be believed. \$\endgroup\$ – angelatlarge Apr 4 '13 at 2:56
  • \$\begingroup\$ Added two more options with varying TWI/I2C hardware support \$\endgroup\$ – helloworld922 Apr 4 '13 at 3:36
  • \$\begingroup\$ The ATTiny48 looks like just what I wanted. Even has the integrated oscillator. Thanks :) \$\endgroup\$ – K. Barresi Apr 4 '13 at 4:01
  • 1
    \$\begingroup\$ The problem with the TWI (I2C) in most of the ATtiny devices is that it isn't hardware, but a apart of the USI (universal serial interface) so part of it still has to be handled with software. In many cases, it may be better to implement the entire thing in software than to use the USI. The mega48 may be the best way to go. \$\endgroup\$ – Kurt E. Clothier Apr 4 '13 at 6:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.