Beginning with the principle of the USI and I~2C, taking Attiny26 as example, which belongs to AVR series, this article describes how to achieve the master mode and slave mode of I~2C by USI, and introduces how to write and read the EEPROM in master mode.