Hi,
i use these code to initial I2c device in F28033
{
InitI2CGpio();
// Initialize I2C
I2caRegs.I2CMDR.bit.IRS = 0; // Reset I2C module
I2caRegs.I2CMDR.bit.MST = 1; // Master
I2caRegs.I2CMDR.bit.TRX = 1; // Transmitter Mode
I2caRegs.I2CMDR.bit.BC = 0; // 8-bit per data byte
I2caRegs.I2CSAR = I2C_SLAVE_ADDR; // Slave Address. 10100xx
I2caRegs.I2COAR = 0x002D; // Address as Master.
I2caRegs.I2CPSC.all = 5; // Prescaler - need 7-12 Mhz on module clk 60Mhz/(5+1)=10Mhz
I2caRegs.I2CCLKL = 45; // NOTE: must be non zero
I2caRegs.I2CCLKH = 70; // NOTE: must be non zero
I2caRegs.I2CIER.all = 0x0; // Disable all interrupts
I2caRegs.I2CMDR.bit.IRS = 1; // Take I2C out of reset
// Stop I2C when suspended
I2caRegs.I2CFFTX.all = 0x6040; // Enable FIFO mode and TXFIFO
I2caRegs.I2CFFRX.all = 0x2040; // Enable FIFO mode and RXFIFO
I2caRegs.I2CSTR.all = 0xffff; ///////////////////////
}
but after lat command, I found I2caRegs.I2CSTR.bit.BB always is 1; what shall i do to clear this bit?