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.
Hi Expert,
Please tell me about the usage of I2C. The currently used SDK version is "TivaWare_C_Series-2.2.0.295".
The customer needs to be able to continuously transmit 2 bytes of data through I2C. Currently, only the example of "humidity_sht21" has been found.
The I2C_MASTER_CMD_SINGLE_SEND method is used, which can only transmit one Bytes of data.
So the customer refers to "Using Feature Set of I2C Master on TM4C129x", file
Inside I2C_MASTER_CMD_BURST_SEND_START & I2C_MASTER_CMD_BURST_SEND_FINISH,
The method implements the transmission of 2 bytes of data.
But a strange problem will arise,
Sometimes only 1 byte of data is transmitted, and the other byte is not transmitted (as shown below).
The following is the customer's code. I would like to ask if this is how the customer uses it?
If there are examples that you can refer to, please provide them.
Thanks
Daniel
Hi Daniel,
In your code, everywhere you have while(I2CMasterBusy(I2C0_BASE)) please add while(!I2CMasterBusy(I2C0_BASE)) before it. See below.
Replace:
while(I2CMasterBusy(I2C0_BASE));
With:
while(!I2CMasterBusy(I2C0_BASE)); // Add this new line
while(I2CMasterBusy(I2C0_BASE)); // Keep this original line.
Make sure you do this on every line you have a while(I2CMasterBusy(I2C0_BASE));