Introduction

The Two-wire Serial Interface (TWI) is compatible with Philips I2C protocol. The bus allows simple, robust, and cost effective communication between integrated circuits in electronics. The strengths of the TWI bus is that it is capable of addressing up to 128 devices using the same bus, arbitration, and the possibility to have multiple masters on the bus.

A hardware TWI module is included in most of the AVR devices.

This application note describes a TWI slave implementation in the form of a full-featured driver and contains an example usage of this driver. The driver handles transmission according to both Standard mode (<100kbps) and Fast mode (<400kbps).