AnsweredAssumed Answered

I2C Slave Send not working as expected

Question asked by David Lundquist on Feb 24, 2015
Latest reply on Feb 25, 2015 by Adrian Cano

I've got a project with a KLZ05 and I'm trying to use the PE code manage the I2C interface.  Device is configured in slave mode and I can send data to the micro without any problems.  My difficulty is reading from KLZ05 in slave mode. 

 

I get to a valid CI2C1_OnReadReq event which means the CPU saw the incoming address and the read read bit.  In that event handler routine I call CI2C1_SendChar() provide the send data to the I2C interface in response to the read request.  I never see any valid read data on the master side.  What is interesting is that I do see the last byte written to the KLZ05 as my read data.  I think this means that the host is just reading back the data register of the I2C controller.

 

Is there something i need to do to enable the PE code to feed the TX data to the I2C interface beyond calling the CI2C1_SendChar() routine?    Some good examples would be a big help.

 

Thanks!

Dave

Outcomes