Hey all,
I'm neck-deep in a project using the LPC55S69 microcontroller, and I'm hitting a wall with I2C communication. In my setup, the LPC55S69 is the boss (master), trying to chat with a temperature sensor (slave).
Here's the breakdown of the problem:
I've been through it all: double-checked the slave address, made sure the pull-up resistors on the I2C lines are there and the right value (4.7k ohms), and even followed the example code from the SDK religiously. Still stuck.
Anyone else out there wrestled with similar gremlins on the LPC55S69 or I2C in general?
Here's a slice of my initialization code, just in case it helps:
I2C_MasterConfig_t masterConfig;
I2C_MasterGetDefaultConfig(&masterConfig);
masterConfig.baudRate_Bps = 100000U; // 100kHz
I2C_MasterInit(I2C0, &masterConfig, CLOCK_GetFreq(kCLOCK_Fro48M));
uint8_t dataBuffer[2] = {0x00, 0x00}; // Register address to read from
i2c_master_transfer_t masterXfer;
memset(&masterXfer, 0, sizeof(masterXfer));
masterXfer.slaveAddress = 0x48;
masterXfer.direction = kI2C_Read;
masterXfer.subaddress = 0x00;
masterXfer.subaddressSize = 1;
masterXfer.data = dataBuffer;
masterXfer.dataSize = sizeof(dataBuffer);
masterXfer.flags = kI2C_TransferDefaultFlag;
status_t status = I2C_MasterTransferBlocking(I2C0, &masterXfer);
if (status != kStatus_Success) {
PRINTF("I2C communication failed\n");
}
I also check this : https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-I2C-stuck-after-SCK-disconnect-connect/td...qliksense But I have not found any solution.
Any advice or suggestions would be greatly appreciated. Thank you!
Thanks
Hello,
Can you please explain this in more details.