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.

CCS/TMS320F28388D: In I2c module A, start bit is not getting even after setting it manually in conjection if the other register value

Part Number: TMS320F28388D

Tool/software: Code Composer Studio

Hi,

I am testing some function calls which I have written for the i2c module. So when I tested the EEPROM with my driver code, I was facing one issue that it is not setting the STT bit of the I2CMDR register. 

I have configured it correctly as I am resuing the driver code. 

Following configurations I did to perform the I2c test:

1. It is set to master transmitter mode, as the TRX bit of I2CMDR is set.

2. After resetting, I have restarted the module in the i2c initialization function.

// -> Disable the I2C Module.
I2caRegs.I2CMDR.bit.IRS = BIT_CLEAR;
// -> Set the pre-scalar register to get the required I2C module
// frequency
I2caRegs.I2CPSC.all = I2C_MODULE_FREQ_PRESCALAR;
// -> Disable the interrupts
I2caRegs.I2CIER.all = DISABLE_INTERRUPTS;
// -> Initialize the Clock low-time divide-down value.
I2caRegs.I2CCLKL = u16ClockTimes[eReqdI2cBaudRate][ONE];
// -> Initialize the Clock high-time divide-down value.
I2caRegs.I2CCLKH = u16ClockTimes[eReqdI2cBaudRate][ZERO];
// -> Enable the I2C module
I2caRegs.I2CMDR.bit.IRS = BIT_SET; //BIT_SET =1

This is the flow of the configuration.

3. After checking the busy bus condition, (which is false of course) it will set the start bit

// -> Initialize the I2C module to act as a master
I2caRegs.I2CMDR.bit.MST = SET_I2C_MASTER;

// -> Set the slave address in the slave address register.
I2caRegs.I2CSAR.all = (strptrI2cMessage->u16NodeAddress);

// -> Set the transmit or receive flag in the I2C mode register
// based on the operation to be performed.
I2caRegs.I2CMDR.bit.TRX = (u16Operation);

// -> Start the communication on the I2C bus by setting the start
// bit in the I2C Mode register
I2caRegs.I2CMDR.bit.STT = BIT_SET;

4. Here it is successfully copying the data to the transmission buffer register; 

I2caRegs.I2CDXR.all = u16Data;

After setting the required configuration the busy bit (BB in I2CSTR) is setting even after the start bit is not getting set. I am not sure what I am missing according to the I2c module operation.

Below is the screenshot of the register values. Note that the current value for the I2CSTR register is 0x1410h.

 


 

Please let me know if I am missing something

Thanks & Regards,

Gurusha