I2C communication issue

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

I2C communication issue

9,572 Views
yoursanil3
Contributor II

Hello Everyone!!!

I am using MK22FN512VLL12 controller in my project, I have initialized I2C1 to communicate with ADC7924 as an initial task i have tried to read the device ID of ADC, i am using frdmk22f_i2c_polling_b2b_transfer_master SDK example for my reference. I have observed that the function I2C_MasterTransferBlocking();
is returning a value 0f 1105 which states that slave is not acknowledged i have cross verified with the device address and also with the hardware and the way that i am writing to the sensor everything looks fine but cant able to detect the device ID.

I also tried to write another I2C which is using for DAC there also i am facing the same issue.

can anyone help regarding this. got stuck here and struggling a lot.

please find the attached pics which can help you better to understand.

Thank you,

regards,

ANIL.

7 Replies

9,535 Views
Joey_z
NXP Employee
NXP Employee

hi,yoursanil3

Thank you for your interest in NXP Semiconductor products and the opportunity to serve you, I will gladly help you with this.

Please check your program to make sure that the slave address you are using is consistent with the address set in the program. We do not have the third-party ADC module you are using, and it is recommended to use a logic analyzer to capture and analyze the transmitted data.

XuZhang_0-1721102693310.pngXuZhang_1-1721102703376.png

 

BR

Xu Zhang

0 Kudos
Reply

9,469 Views
bobpaddock
Senior Contributor III
The Slave Addresses shown in Table-2 are seven-bit values. They need shifted left by one bit to allow for the R/W bit. With A0 tied high the correct slave address is 0x92.

Different manufacture's show the addresses shifted or unshifted in the data sheets and it screws us all at some point.


0 Kudos
Reply

9,427 Views
yoursanil3
Contributor II

Hi @bobpaddock

If we consider the function that which i am calling it initially takes the 7 bit address and after that R/W bit. please find the attached.. Anyways i  have tried with the address that you have suggested still facing the issue.

Thank you,

regards,

ANIL.Screenshot (19).png

0 Kudos
Reply

9,529 Views
yoursanil3
Contributor II

Hi XuZhang,

I am using an external ADC ie., ADC 7924, i have tried to capture the data through oscilloscope and observed that slave address is not acknowledged to the master i have cross verified with the slave datasheet and our hardware board and can confirm the slave address is same i also checked with voltage levels that were given to slave and they were also fine.

please find the attached, slave address is 0x49 and after that write bit then slave has to acknowledge to that by keeping the SDA low but the line is going high.

Thank you,

regards,

ANIL.IMG_5619 (1).JPG

 

0 Kudos
Reply

9,493 Views
Joey_z
NXP Employee
NXP Employee

hi,yoursanil3

If a device is not present on the bus, and the master attempts to address it, it receives a not-acknowledge because no device is present at that address to pull the line low.

I saw in some off-chip ADC module documents that if you want to set the address of this module, you should pull a certain pin low or high in the hardware settings. Please confirm whether you have done so.

XuZhang_0-1721188587253.png

You can also send me the instruction manual of the ADC module you use so that I can learn more information and help you.

BR

Xu Zhang

0 Kudos
Reply

9,481 Views
yoursanil3
Contributor II

Hi XuZhang,

As said by you i have confirmed that the slave address pin ie, A0 is set to high on the hardware by connecting it to DVDD verified with the voltage levels which are fine.

I have attached the datasheet please find the attached.

regards,

ANIL.

 

0 Kudos
Reply

9,420 Views
Joey_z
NXP Employee
NXP Employee

hi,yoursanil3

You can check in the I2C_MasterStart function whether the address has been shifted in the program.

XuZhang_0-1721301222331.png

Here are some suggestions for you to check.
1. Make sure the hardware connection is correct, there is no cold soldering, and whether the power supply voltage may be insufficient or unstable.
2. Confirm whether the I2C communication rate matches the rate supported by the slave.

XuZhang_1-1721301237934.pngXuZhang_2-1721301249943.png

BR

Xu Zhang

0 Kudos
Reply