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++;
}