Tool/software:
Hi all,
I have a query regarding the driverlib functions call regarding I2C example.
I need to send 27 bytes to the SSD1306 display device for initializing it via I2C.
When I try to send only the first 16 characters to the I2C slave, i get the required data on the I2C bus. I verified it using the logic analyser :

When I try to send the 27 characters in two batches, 16+11, I get only the last 16 bytes in the I2C bus, 5 from the first batch and 11 from the second batch. Logic analyser output:

I have pasted the relevant i2c function code below.
It would be helpful if some one can point out what I am doing wrong :
void init_i2c_module()
{
// https://software-dl.ti.com/C2000/docs/C2000_driverlib_api_guide/f2837xd/html/modules/i2c.html#
I2C_disableModule(I2CA_BASE);//Before initializing the I2C module, the user first must put the module into the reset state
I2C_initMaster(I2CA_BASE, DEVICE_SYSCLK_FREQ, 10000, I2C_DUTYCYCLE_50);//the user must then call I2C_initMaster() which will configure the rate and duty cycle of the master clock.
I2C_setDataCount(I2CA_BASE, 16);// Set data count must be before enable fifo
I2C_enableFIFO(I2CA_BASE);
I2C_setConfig(I2CA_BASE, I2C_MASTER_SEND_MODE);//I2C_setConfig() should be called to configure the behavior of the module
I2C_setSlaveAddress(I2CA_BASE, 0x3C);
I2C_enableModule(I2CA_BASE);
I2C_putData(I2CA_BASE,0x00);// First byte: Command identifier 0x00 is the first byte, remaining 15 bytes are put in the FIFO using for loop below
for (iter=0;iter<=14;iter++)// Remaining 15 bytes of the init data to fill up the FIFO
{
I2C_putData(I2CA_BASE,s_oled128x64_initData[iter]);
}
I2C_sendStartCondition(I2CA_BASE);
I2C_sendStopCondition(I2CA_BASE);
// Of the total 27 bytes, 16 sent earlier, 11 more are pending.
I2C_setDataCount(I2CA_BASE, 11);
for (iter=15;iter<=24;iter++)// 10 bytes from initdata populated in the FIFO using for loop
{
I2C_putData(I2CA_BASE,s_oled128x64_initData[iter]);
}
I2C_putData(I2CA_BASE,0xA5);// Last command byte to light up the screen is the 27th byte.
I2C_sendStartCondition(I2CA_BASE);//A start condition can be sent by a master using I2C_sendStartCondition()
I2C_sendStopCondition(I2CA_BASE);//A start condition can be sent by a master using I2C_sendStartCondition()
}
Thank you for your time
Balaji.


