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 are its capability to address up to 128 devices using the same bus and arbitration, and the possibility to have multiple masters on the bus.

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

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