2024-12-28 01:52 PM
I am using LL library on STM32F446 for an I2C master, I am trying to comunicate with a device with 0x7B address, after sending the address I don't get the ADDR flag, insted I get ADDR10
Here is my interrupt code:
if (LL_I2C_IsActiveFlag_SB(I2C1)) {
LL_I2C_TransmitData8(I2C1, 0x7B << 1);
}
if (LL_I2C_IsActiveFlag_ADD10(I2C1)) {
LL_I2C_TransmitData8(I2C1, 12);
}
With this code I successfully send the "12" value.
Here logic analizer's output:
If I try to detect ADDR "0C" byte is never sent. How could I fix this issue (I could just keep checking ADDR10, but subopimal)
Solved! Go to Solution.
2024-12-30 06:27 PM - edited 2024-12-30 06:30 PM
Note that 0x7B is a reserved address and isn't a valid 7-bit address. Perhaps the chip you are interfacing with is set up for 10-bit addresses. In which case you should send the second byte of the 10-bit address in response to the ADD10 flag.
It's not clear if setting ADDMODE bit is required to start 10-bit addressing, or if sending the header 0b11110xxx initiates 10-bit address mode as a master. My guess from reading the RM is the latter.
2024-12-30 06:27 PM - edited 2024-12-30 06:30 PM
Note that 0x7B is a reserved address and isn't a valid 7-bit address. Perhaps the chip you are interfacing with is set up for 10-bit addresses. In which case you should send the second byte of the 10-bit address in response to the ADD10 flag.
It's not clear if setting ADDMODE bit is required to start 10-bit addressing, or if sending the header 0b11110xxx initiates 10-bit address mode as a master. My guess from reading the RM is the latter.