This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28069: I2C reading happen too fast at the start

Part Number: TMS320F28069

I read the I2C receive register in a 100 uS loop for 10 bytes. But every time i begin to read, as soon as the address byte been written, first three bytes come too fast. rest of the bytes comes 100us apart as expected.
  My I2C frequency is 300k.  This is the logic analyzer output.
Top one is SCL line and second one is SDA line.
Data bytes are represented with blue squares including address byte with R indicated on the top of the blue square.
Bottom squared line shows the start of each reading cycle after address byte transmitted.
As you can see, before the reading loop starts, two bytes comes before beginning of the reading loop starts.
Why is that happens.

This is the read start code
                   if(I2caRegs.I2CMDR.bit.STP ==0 ){
                I2caRegs.I2CSAR = address;
                I2caRegs.I2CCNT = datalength;
                I2caRegs.I2CMDR.all=0x6C20;
}


this is the data reading loop code

            if(I2caRegs.I2CSTR.bit.RRDY==1){
                GpioDataRegs.GPATOGGLE.bit.GPIO24=1; // This used to monitor the running of the loop.
                recevearray[(*v).dataReceveIndex]=I2caRegs.I2CDRR;
                (*v).dataReceveIndex++;
            }

  • Hi Damith,

    Can you further explain the issue your having? It's not clear to me. From your waveforms it looks like 1's are being transmitted on the SDA line, is that the intention? If not, what are you expecting to see?

    Is the F2806x the master or slave device in your setup?

    Best,

    Kevin

  • Hi kevin

    This problem occurs in the master receiver mode.

    Actually those are 0xFF s and its intentional. Data shown on the I2C bus is exactly what i was expecting. Problem is the time stamp it receives.

    As soon as i configured the I2C module to receive, it receives two data bytes before i starts to read. But i starts to read the receive register After 100us. Then subsequent readings also done  in a 100us loop.  But, As you can see, the first two bytes receives before 100us interval. But then it reads the data in 100us. Edges in the bottom squared line shows the 100us reading loop execution.

    I tested it it with only the configuration part, without reading the I2C receive register. relevant code shown below.  Result is same. Two bytes receives as soon as the slave address transmitted. following figure shows this scenario.

    Why there are two bytes comes before i begin to read. used a different slave device and result is same.

            if(I2caRegs.I2CMDR.bit.STP ==0 )
                {
                I2caRegs.I2CSAR = address;
                I2caRegs.I2CCNT = datalength;
                I2caRegs.I2CMDR.all=0x6E20;

    }

  • Hi Damith,

    It seems that your waveforms here do not match up because your original post uses the master as a receiver (0x6C20) while your second post uses the master as a transmitter (0x6E20). Why was this done?

    Also the I2C has a 4 byte buffer, this could be the source of the original 2-3 data bytes. 

    Thanks