I am using the piccolo f28069 at 90Mhz.
I checked the CPU speed at the pin GPIO18 using the scope (got 22.4Mhz with XCLKOUTDIV=0 ).
I configured the I2C slock to run at 400kbit/s see code below but I got only 106kbit/s measured with the scope !!!
Any Idea where can be the problem?
Thank you
Hamid
void I2CA_Init(void)
{
// Initialize I2C
I2caRegs.I2CSAR = I2C_SLAVE_ADDR; // Slave address
I2caRegs.I2CPSC.all = 8; // IPSC = 8 Prescaler - need 7-12 Mhz on module clk CLK module = 90/(8+1)= 10Mhz
//IPSC = 8
//Tmodul*[(ICLL+d)+(ICCH+d)]=Tmaster=400khz
// low periode = Tmod*(ICCL+d)
// High periode = Tmod*(ICCH+d)
//low periode > High periode (2 time appr)
//d=5 for IPSC >1
I2caRegs.I2CCLKL = 10; // NOTE: must be non zero
I2caRegs.I2CCLKH = 5; // NOTE: must be non zero
//I2caRegs.I2CIER.all = 0x24; // Enable SCD & ARDY interrupts
I2caRegs.I2CIER.all = 0x00; // disable all interrupts
I2caRegs.I2CMDR.all = 0x0020; // Take I2C out of reset
// Stop I2C when suspended
I2caRegs.I2CFFTX.all = 0x6000; // Enable FIFO mode and TXFIFO
I2caRegs.I2CFFRX.all = 0x2040; // Enable RXFIFO, clear RXFFINT,
return;
}
