I am using the M24LR16-E EEPROM which is an I2C device:
I am using the Nordic nRF52 Development Board for the EEPROM to be intefaced to.
In Nordic's SDKv12, there is a sample application which uses TWI to scan for connected I2C devices with the microcontroller. Kindly see code snippet below for the scanning procedure.
When I run this, the M24LR16-E cannot be detected. However, when I connect a Bosch's Barometric Pressure Sensor (BMP180) to the I2C bus, both of them are detected and the correct device select codes are printed.
Why is this happening? The read and write functions that I wrote for the M24LR16-E are working, though. Does this have anything to do with timing issues?
Thank you in advance.
Scanning for I2C device procedure:
for (address = 1; address <= 127; address++)
{
err_code = nrf_drv_twi_rx(&m_twi, //twi config structure
address, //device select code
&sample_data,sizeof(sample_data));
if (err_code == NRF_SUCCESS)
{
detected_device = true;
NRF_LOG_INFO("TWI device detected at address 0x%x.\r\n", address);
}
NRF_LOG_FLUSH();
}
if(!detected_device)
{
NRF_LOG_INFO("No device was found.\r\n");
NRF_LOG_FLUSH();
}
Also see image for the outputs (both EEPROM and pressure sensor connected to the I2C bus):