Part Number: TM4C1294NCPDT
Tool/software: TI-RTOS
I am using a TM4C1294NCPDT on a TI eval board and I have the I2C all working well. I am using the RTOS API to use the I2C. My sudo code is as follows:
init_i2c_devices(); // inits the device pins and calls I2C_init();
I2C_Params_init(&i2cParams);
i2cParams.transferMode = I2C_MODE_CALLBACK;
i2cParams.transferCallbackFxn = I2C_completeCallback0; // specify the callback here.
i2cParams.bitRate = I2C_100kHz; // Here is where I set the I2C speed.
// Open I2C 0 for channel 0
i2c_Handle[I2C_CH0] = I2C_open(0, &i2cParams);
if (i2c_Handle[I2C_CH0] == NULL)
{
System_abort("Error Initializing I2C 0\n");
}
My question is I have a device the Tiva talks to via I2C that would be more reliable if I used a slower speed than 100k when I update it's firmware.
I tried using the following call and where I would set the variable slowI2C to different numbers and got un predictable results for the I2C speed.
ROM_I2CMasterInitExpClk(I2C0_BASE, SysCtlClockGet()*slowI2C, 0);
What would be the recommend method to slow the I2C down and do some operations and then restore the speed back to the 100K speed? For example, if I wanted to slow theI2C from 100kHz to 50kHz and do some operations and then restore the I2C speed back to 100kHz.
Thanks,
Doug