Gast
#1895032
Hallo, in der Atmel APP Note AVR312 wird vorgestellt wie das USI IF als I2C slave konfiguriert wird. Der Demo Code läuft einwandfrei auf einem ATtiny84. Laut Demo Code werden die Port Pins wie folgt initialisiert: PORT_USI |= (1<<PORT_USI_SCL); // Set SCL high PORT_USI |= (1<<PORT_USI_SDA); // Set SDA high DDR_USI |= (1<<PORT_USI_SCL); // Set SCL as output DDR_USI &= ~(1<<PORT_USI_SDA); // Set SDA as input An der Stelle ist mir nicht klar: 1.) Warum der SCL Pin des slave (!) als output konfiguriert wird. ( Wenn ich die SCL Konfiguration auskommentiere klappt die Kommunikation nicht ) 2.) Trotz externer Pull Up Widerstände der interne SDA Pull Up aktiviert werden muss. ( Wenn ich die PORT_USI |= (1<<PORT_USI_SDA); Zeile auskommentiere klappt die Kommunikation nicht ) Hat jemand eine Idee ?