Hello,
I am trying to read data from a slave processor which will send 2 byte of data whenever it receives clock from the master.
This 28379D processor gets data in the buffer but it does not send stop command after I2caRegs.I2CCNT = 2; becomes 0. here is the scope image of transaction but clock remains low as the stop condition is not sent.
here is my initialization code:
I2caRegs.I2CPSC.all = 19; // Prescaler - need 7-12 Mhz on module clk
I2caRegs.I2CCLKL = 495/2; // NOTE: must be non zero
I2caRegs.I2CCLKH = 495/2; // NOTE: must be non zero
I2caRegs.I2CIER.all = 0x24; // Enable SCD & ARDY __interrupts
I2caRegs.I2CSAR.all = 0x0044; //
I2caRegs.I2CFFRX.all = 0x6000;
routine:
I2caRegs.I2CMDR.all = 0x6C20; //0x2E20;
while(I2caRegs.I2CFFRX.bit.RXFFST <2) {}
for(j =0 ;j < 2; j++){
data[j] = I2caRegs.I2CDRR.all;
Kindly let me know what should I do ? the slave will always sends two byte of data.