I am using an ATtiny841 microcontroller as an I2C slave, but I have difficulty finding information on it. So for, all I have are application notes and reference code for TWI and USI module.

It seems like ATtiny841 has a unique TWI slave interface, which is slightly different. Although I could write out the code manually it would really help if there is a standard sample code that I can refer to.

Any suggestions?

Thanks in advance.

  • 1
    \$\begingroup\$ Does AVR311 not contain what you need? \$\endgroup\$ Mar 17, 2015 at 1:23
  • \$\begingroup\$ AVR312: Using the USI module as a I2C slave atmel.com/Images/doc2560.pdf \$\endgroup\$
    – vicatcu
    Mar 17, 2015 at 2:06
  • \$\begingroup\$ @Ignacio: Yes, AVR311 is the one that I'm currently referring to. It is based on the more general TWI module found in ATmega controllers. \$\endgroup\$
    – bot3663369
    Mar 17, 2015 at 4:13
  • \$\begingroup\$ @vicatcu: I have used USI on other ATtiny controllers, but 841 does not have USI. \$\endgroup\$
    – bot3663369
    Mar 17, 2015 at 4:16

1 Answer 1


You should be able to use the TWI example code as-is, since TWI is I2C: What is difference between I2C and TWI?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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