IIC read/write component ADS1015 issue

cancel
Showing results for 
Search instead for 
Did you mean: 

IIC read/write component ADS1015 issue

462 Views
1120905896
Contributor I

At first, I should let you know chip is S32K144, and it's a master. ADS1015 is slave address.  Slave address is 0x4A.

I send four bytes to the IIC bus, first byte is slave address, second is register pointer. third and fourth are the parameters about the register in ADS. 

But I use oscilloscope to get the wave form.it only send slave addr. Please see the following picture.

I find it receive the ACK signal. But In the default ISR, it shows that receive NACK.

But it can execute write operation. See the following picture.

The function I use is LPI2C_DRV_MasterSendData();

Can you give me some suggestions for this issue?

Thanks for your support firstly.

Best regards,

Xiaowei.

Tags (4)
0 Kudos
7 Replies

255 Views
__invited__ali3
NXP Employee
NXP Employee

Hello,

The problem is that the master is not able to send data, but is able to receive(from capture 2 I see that master is receiving). Did I understood correctly?

The SDA waveform don't look well. Please be sure you configured both SDA and SCL pins as open-drain.
Do you use the internal pull-ups resistors? I recommend to disable the internal pull-ups and use external pull-ups resistors(~4.7KOhm, one for SCL, one for SDA).

Please let me know if you succeeded or if you have any questions.

Best regards,
Alina

0 Kudos

255 Views
1120905896
Contributor I

Hello Alina,

Thanks for your reply.

Please let me know why the master can't send data and also how to config it to let the master can send data.(I use PE to config pins)

Best regards,

Xiaowei.

0 Kudos

255 Views
__invited__ali3
NXP Employee
NXP Employee

Hello,

Have you tried using the lpi2c_master_s32k144 example? There you could see how the SCL and SDA pins are configured.

If you have configured the pins as they are configured in example, and it's still not working, I recommend to use external pull-ups. For this you need two pull-ups resistors of 4.7Kohm each. Wired one between VDD and SCL pin, and the other between VDD and SDA pin.

If you use external pull-ups resistors, you should disable the internal ones (see capture attached).

pastedImage_1.png


Please let me know if you still have problems.

Best regards,
Alina

0 Kudos

255 Views
__invited__ali3
NXP Employee
NXP Employee

First make sure you have wired slave GND to master GND, because it seems that the GND level is lower for slave. 

0 Kudos

255 Views
1120905896
Contributor I

Hello Alina,

   In my first picture, it seems that the electrical level of the ninth clock pulse is low. So it is ACK. but the NACK flag in MSR is 1.  I don't know which cause it. It makes me so confused.

Please give me some suggestions.

Best regards,

Xiaowei.

0 Kudos

255 Views
__invited__ali3
NXP Employee
NXP Employee

Hello,

From the first capture I see that indeed the slave is sending ACK on the ninth clock, but also I see that the level of 0 is below the previous zeros from the address that was sent from master. It looks like slave and master don't have common GND.

Have you tried using external pull-ups? Could you please detail for what you are using PTE16 and PTE11 pins?

Could you provide me the project that you are using for master?

Best regards,
Alina

0 Kudos

255 Views
1120905896
Contributor I

Hello Alina,

I just tried the example, and it seems failed. I only disable the PTA2 and PTA3 for pull.  And pull up PTE16 and PTE11. 

It seems that I can't send anything except slave addr. And please see the first capture in my first message. In the wave form,it seems that I receive ACK from slave.

0 Kudos