MKE15Z256 IIC read clock data failure

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

MKE15Z256 IIC read clock data failure

788 Views
加奖张
Contributor I

Hello, everybody.

At present, I use MKE15Z256 MCU to debug the IIC module, and slave is the clock chip ISL1208..

Process: the single chip microcomputer is set as the host mode, when the clock chip is written, there is no problem. The waveform of SDA and SCL observed on the oscilloscope is consistent with the program, and the response is accurate.

Problem: when you read out the time written into the clock chip, you can't get it right. The use of register LPI2C1->MTDR is not very clear. The process of reading:

1. send a read instruction to the slave, no problem. After sending, SDA and SCL are also set low, and the bus is delivered to slave.

2. is ready to read a byte data, when the LPI2C1->MTDR=0x100 is set, 9 bits of data are observed on the SDA signal, and the first 8 bits are the same as the written data, but there is no response at this time. Therefore, the SDA signal is set up again, resulting in the readings of NG.


Does anyone know about this microcontroller IIC when reading data? Do you have code? Trouble helping to solve the problem, thank you.

0 Kudos
3 Replies

685 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

KE15Z has freedom develop board and SDK. On that board KE15Z connect with a ACCELEROMETER chip by I2C bus. The manner they set I2C is similar with ISL1208. Please refer to the demo in FRDM-KE15Z sdk.

You said that after you restart and send read byte, there is no ACK on the bus. So I think this maybe caused by ISL1208 config. I found some other code for ISL1208, maybe it can help you.

https://os.mbed.com/users/neilt6/code/ISL1208/file/c0635401a37f/ISL1208.cpp/

Regards,

Jing

0 Kudos

685 Views
加奖张
Contributor I

dear jing:

This is another question for me to debug. Please look at it. Thank you.

Regards,

jiajiang

0 Kudos

685 Views
加奖张
Contributor I

dear jing:

thank you very much for your reply during your busy schedule. I have read your advice, I have seen some of them, but I still can not solve the problem. The attachment is my program, and the waveform. Please look at it and help me analyze whether there is any mistake.

Regards,

jiajiang

0 Kudos