AVR_I2C_example example code for i2c communication between two avr chips also see http://pengu.student.utwente.nl/wordpress/?p=136