Part Number: TM4C1290NCPDT
Other Parts Discussed in Thread: TM4C1294NCPDT
Dear community,
I am using the TM4C1294NCPDT in order to (among other things) read data from a magnetometer sensor using I2C.
Reading out the sensor with busy waiting works great, and I can also see the I2C clock and data line on a scope, so I am sure that the MCU, the sensor, and the printed circuit board are fine.
As I use the MCU to send the data using Ethernet, I want to use the FIFO and uDMA together with the I2C to be faster. For starters, I just use the FIFO (without the DMA).
My question is why the following code gives me two bytes of signal on the line (namely a "write to slave 0x0E" followed by the data byte 0x01)
// Set slave address for writing I2CMasterSlaveAddrSet(I2C2_BASE, 0x0E, 0); // Transmit a byte (place it in the I2C data register) I2CMasterDataPut(I2C2_BASE, 0x01)); I2CMasterControl(I2C2_BASE, I2C_MASTER_CMD_SINGLE_SEND);
but the following code
// Set slave address for writing I2CMasterSlaveAddrSet(I2C2_BASE, 0x0E, 0); // use the FIFO to send 0x37 = 55 I2CFIFODataPutNonBlocking(I2C2_BASE, 55); I2CMasterControl(I2C2_BASE, I2C_MASTER_CMD_FIFO_SINGLE_SEND);
only gives me 0x37 on the line (but not the byte which says "send to slave0x0E").
I already had a look at all the bits in the register description for I2CMSA, I2CMCS, and I2CMDR. Turns out that the only difference between the single send commands is that the BURST bit is set for the FIFO, and the RUN bit when I don't use the FIFO. This is in accordance with the datasheet. This should not affect putting the slave address on the line though, should it? I cannot find this information in the datasheet.
How can I make sure that even when I use the FIFO, the slave address is put on the line? After all I need this to talk to the specific slave.
Thank you!