Turn-key PCB assembly services in prototype quantities or low-volume to mid-volume production runs

Programming AVR I2C interface

I2C interface (also referred to as IIC or TWI) is a widely used interface in embedded applications. Two wire bus initially was used by Philips and become a standard among chip vendors. I2C bus consists of two lines called Serial Data Line (SDA) and Serial Clock Line (SCL). Communication is relatively fast, and short distance mainly used to communicate between sensors, RTC, EEPROM, LCD. I2C protocol allows up to 128 devices connected to those two lines where each of them has a unique address. Communication between devices is master and slave-based. Master generates a clock signal, initiates, and terminates data transfer. From an electrical point of view, I2C devices use open drain (open collector) pins. For correct operation, SDA and SCL lines require pull-up resistors. Typically 4.7kΩ resistors are used. Continue reading