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.

MSP430F169: How do you read from a SPECIFIC address using I2C?

Part Number: MSP430F169

My master is an MSP430F169. My slave is an SI514. I just want to read a specific address right now, and I am struggling to do that. I can read from the slave, but can't specify which address I want to start at. I know how you are supposed to do it, I just am not exactly sure how to write the code, and I have looked through many many examples and none of them do this. Here is the code I have (not including all the setup):

U0CTL |= MST;                                     

I2CTCTL |= I2CSTT + I2CSTP;

// right here is probably where I need to tell the slave where I want to read from, which is address 0x84

while ((I2CIFG & RXRDYIFG) == 0);
   
data_im_reading = I2CDRB;
Please don't send me a link to examples unless you are absolutely certain that the examples have the solution to this very simple problem. I have seen many examples, but none of them do what I am trying to do. All I want to do is be able to read from specific addresses, and be able to write to a specific addresses. I have a lot of examples, and none of them do that. Thank you.
  • The principle is that you precede the read transaction with a write, which sends 1 (sometimes 2) bytes which give the register number. That number is remembered by the slave and the next read uses that as an index. Typically the slave increments that internal index after each byte is read .

    But I haven't used I2C from an F1 series device, so I'm not much help with specifics.

**Attention** This is a public forum