I2C Manual ACKing issue on Kinetis MKE04

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

I2C Manual ACKing issue on Kinetis MKE04

881 Views
lexsandeford
Contributor I

I'm having an I2C issue with my kinetis MKE04 and was wondering if anyone could help me out?

The problem is this:  I have the kinetis set up as a slave on an I2C line, and am trying to manually ACK.  I am ACKing when I get an Rx or Tx request, on reception of a byte and block.  I, however, am seeing a strange issue.  There is an EEPROM on the I2C bus, with address 0x50 (the kinetis is at 0x54).  When it's address is being called, the clock line is being held low by the kinetis (as when I disable manual ACKing, this doesn't happen).  Can anyone think of why this is happening?

Labels (1)
Tags (3)
0 Kudos
5 Replies

718 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hello Lex Sandeford,

  1. Please also provide the I2C problem wave.

  2. Please provide the KE04 slave code.

  3. Please check the KE04 slave address register with debug, just to make sure the address is correct, and also give me the debug picture.

Waiting for your reply!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

718 Views
lexsandeford
Contributor I

Hiya Kerry

Thank you so much for your reply.  I have included the code for the onBusStartDetected event, as this is the only one that is hit by the code at the moment.  The code is basically just for tracking repeated starts.  In the scope trace, you can see that the bus freezes after the r/w bit.  In the debug window, you can see that the 7 bit address is 0x54.  I tried to pick some other useful registers to show - it looks like the bus is busy but the peripheral knows it isn't being addressed... 

pastedImage_2.png

pastedImage_7.png

void SlaveI2C_OnBusStartDetected(LDD_TUserData *UserDataPtr)
{
/* Write your code here ... */
SlaveI2CUserData * SlaveI2cUserData = (SlaveI2CUserData *)UserDataPtr;

MSG("Start!\n");
// If the start flag is TRUE, there has been a start before this start, but not a stop.
// This means there has been a repeated start. We only want to handle repeated starts
// after a write operation.
if (SlaveI2cUserData->_gStart && SlaveI2cUserData->_gWriteRequest)
{
SlaveI2cUserData->_gRepeatedStart = TRUE;
SlaveI2cUserData->_gOffset = SlaveI2cUserData->_gBuffer[0];
// The peripheral is expecting more data, so cancel reception of the rest of the
// data
SlaveI2C_SlaveCancelReceptionBlock(SlaveI2cUserData->deviceData);
// The only possible operation after a repeated start is a read
SlaveI2cUserData->_gWriteRequest = FALSE;
}
else
{
SlaveI2cUserData->_gStart = TRUE;
}
}

0 Kudos

718 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hello Lex Sandeford,

    In your I2C wave, why just 8 bit data in the clock, it seems the master didn't send out the ACK bit in the clock, it should be 8 bit data +1 bit ack.


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

718 Views
lexsandeford
Contributor I

Hiya

Yeah it is strange - it's as if the peripheral is waiting to be told wether to send an ACK/NACK, except that the address being called is for a different peripheral.  

0 Kudos

718 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hello Lex Sandeford,

    So you still need to check your I2C master, actually, even you don't connect the slave, the master still need to send out 8bit+1bit ACK.

Have a great day,
Kerry

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos