Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 216889

Forum Post: RE: TIVA: I2C: Send one byte and get 2 bytes

$
0
0

Hi Zvika,

The Transmit section is fine. In the receive section since you want to recieve two bytes I would change the sequence as follows

I2CMasterControl (I2C6_BASE, I2C_MASTER_CMD_BURST_RECEIVE_START); //Receive

while (I2CMasterBusy(I2C6_BASE)); //Wait till end of transaction

Byte1 = I2CMasterDataGet (I2C6_BASE); //Read from FIFO

I2CMasterControl (I2C6_BASE, I2C_MASTER_CMD_BURST_RECEIVE_FINISH); //Receive

while (I2CMasterBusy(I2C6_BASE)); //Wait till end of transaction

Byte2 = I2CMasterDataGet (I2C6_BASE); //Read from FIFO

Amit


Viewing all articles
Browse latest Browse all 216889

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>