Other Parts Discussed in Thread: EK-TM4C123GXL
Hello Everyone,
I am having issues with i2c transfers having gaps between bytes on both callback and blocking modes.
There are 8 ms gaps between parts of the transfer when using blocking calls.
I thought the internal driver would use interrupts so even if the task switches the bytes are sent properly.
I didn't have the issue with SPI or UART drivers when I was using them.
If I try it with a devkit example that only has a single task I have no issues. The transfer is not broken into parts.
CCS version: 10.1.1.00004
Tirtos version : tirtos_tivac_2_16_00_08 (Installed within ccs, for some reason not the latest)
Tirtos came with TivaWare_C_Series-2.1.1.71b but I am using TivaWare_C_Series-2.2.0.295.
Here is some captures of the i2c lines:
Custom board blocking i2c:
There is a large gap of 7.4 ms on the same transfer.
If I use callback mode it is even worse, there is a 50 ms delay in the middle:
If there is multiple transfers there is multiple cuts in the middle. These cuts are not between transfers they actually go in the middle of transfers.
Some transactions don't get cut but most do.
Here is how I initialize i2c driver.
//Init code I2C_Params i2cParams; I2C_Params_init(&i2cParams); i2cParams.bitRate = I2C_100kHz; I2C_Handle i2c = I2C_open(I2C0, &i2cParams); if (i2c == NULL) { System_abort("Error Initializing I2C\n"); }
Here is my transfer call:
//Transaction call uint8_t buffer[] = {0x06,0x00,0x04,0xFF,0x07,0x00,0x05,0xFF}; I2C_Transaction transaction = { buffer, sizeof(buffer), NULL, NULL, 0x20 }; if(!I2C_transfer(i2c, &cfg_transaction)) { System_printf("Problems sending i2c value.\n"); }
Can anybody help me with the issue please?