AnsweredAssumed Answered

I2C two bytes reading issue

Question asked by syed idris on Aug 17, 2016
Latest reply on Aug 27, 2016 by syed idris

Hi all,

We are trying for I2C interface with kinetis KL03 using KDS3.0.0 + PE

 

We are trying using "fsl_I2C" component in PE. in this  I2C_DRV_MasterReceiveData(); is used.
writing in parameters of this function for "number of data to read" as count=2
expected output is >> Before: 0 0  After: C1 E0
we are getting as >> Before: 0 0 After: 1 FF

 

But

writing in parameters of this function for "number of data to read" as count=1

expected output is >> Before: 0 0  After: C1 0
we are getting as >> Before: 0 0 After: C1 0


Master: KL03
Slave address: 0x18
Data register: 0x05
Number of bytes to read: 2

Clock: Internal clock used (Externally 32.768Khz crystal is not connected)

 

while reading only one byte from slave is giving output as expected, but no luck with reading two bytes from slave.

projet file is attached here, please guide me how to resolve this problem of reading 2 bytes data from slave? Is there any correction in my parameter passing to function?

 

Idris

Original Attachment has been moved to: I2C_2bytesReadingIssue.zip

Outcomes