Hallo,
ich hoffe ihr könnt mir helfen, ich habe ein Problem mit meinem
Atmega1284p und dem I2C-Bus. Der I2C-Slave ist ein Atmel 42QT1070. HIer
erst mal das kleine Programm was schon nicht funktionieren will:
1 | #include <avr/io.h>
|
2 |
|
3 | #include <i2cmaster.h>
|
4 |
|
5 | #define I2C_WRITE 0
|
6 |
|
7 | int main(void)
|
8 | {
|
9 |
|
10 | i2c_init(); // initialize I2C library
|
11 | i2c_start(0x1B+I2C_WRITE); // set device address and write mode
|
12 | i2c_write(0x39); // write address = 39
|
13 | i2c_write(0xFF); // write value 0xFF
|
14 | i2c_stop(); // set stop conditon = release bus
|
15 | }
|
wenn ich mit einem Logikanalysator mir die Kommunikation anschaue
bekomme ich immer als Meldung: Setup Read to [0x1A] + NAK
Ich verstehe einfach nicht wieso die Adresse falsch ist und warum es ein
READ statt WRITE ist. Wenn ich die Adresse ändere ist alles okay bei der
Kommunikation außer das ich natürlich keine Verbindung zum IC bekomme.
Ich hoffe jemand kann mir weiterhelfen.