Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 2 months ago. This question has been closed. Reason: Duplicate question
F746 I2C data transfer size
I ran into an issue in trying to do an I2C read of 256 bytes from a device. All data returns 0xff into the buffer and the F746 goes out to lunch, sometimes requiring the removal of power (the USB cable). I found that 255 byte I2C reads work just fine.
//example 1
I2C i2c(I2C_SDA, I2C_SCL);
char buffer[256];
int main() {
buffer[0] = 0;
i2c.write(0x80, buffer, 1, true);
i2c.read(0x81, buffer, 256, false); //broken
while(1) {
//do stuff
}
}
//example 2
I2C i2c(I2C_SDA, I2C_SCL);
char buffer[256];
int main() {
buffer[0] = 0;
i2c.write(0x80, buffer, 1, true);
i2c.read(0x81, buffer, 255, false); //works
while(1) {
//do stuff
}
}
I am attempting to read the entire RTC + user RAM contents out of a DS3232M in one swoop. This code works fine on a K64F, KL25Z and nRF51822. What is the limitation on a F746?
Regards,
...kevin
Question relating to:
I just ran into this issue again with a 24AA02 I2C EEPROM. I am running the most current mbed library, v122. Any update?
posted by Kevin Braun 26 Jul 2016