Issues with I2C Communication on LPC55S69

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Issues with I2C Communication on LPC55S69

1,403 Views
rohan02
Contributor I

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 set up the I2C thingy using the MCUXpresso Config Tool.
  • The I2C master seems to be waking up just fine, and I can see it controlling the clock and data lines.
  • But here's the snag: when I try to ask the slave for info (send a read command), I don't get a reply. It's like the conversation dies after I introduce myself (send the address byte).

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

Thanks
0 Kudos
Reply
2 Replies

731 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @rohan02 

Can you please explain this in more details.

BR

Harry

0 Kudos
Reply

1,358 Views
eleanelbert
Contributor I

Hello,

Can you please explain this in more details.

0 Kudos
Reply