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.

MSP430FR2355: I2C issuing a restart?

Part Number: MSP430FR2355

When I issue an I2C transmit start my code automatically sends out the address and a write and jumps into the TXIE0 for the first byte.  Can someone tell me when I issue an I2C restart will I jump into the TXIE0 after the address and a read is sent out over the bus OR will I jump into RXIE0?

  • If UCTR=1, you'll get an immediate TXIFG, to let you pre-load the first byte while the SLA byte is in progress.

    If UCTR=0, you'll get an RXIFG after the first byte is in RXBUF.

    I find the diagrams in User Guide Figs 24-12/-13 to be very useful.

  • I'm not gonna lie I've studied these and am having a terrible time reading them...I find them very confusing....For instance....To do a restart I believe.....You should issue UCTR =1, UCTXSTT = 1 which will put out the write device address and place you into the TX ISR portion where you load the TXBUF with the device REGISTER address that you want to read (this is a write ), inside this TX ISR I believe then you must issue a UCTR = 0, UCTXSTT = 1 which will automatically place the read device address onto the bus.  This in turn will avoid a stop on the bus.  Then inside the RX ISR the master will produce 8 clocks + nack clock) in which you should receive your data....Inside this ISR I believe then you issue a UCTXSTP.....

  • That sounds about right, though I suggest issuing the second Start on the second TXIFG (after the I2C has started to transmit the first byte). I'm not quite sure what happens if you change UCTR in the middle of sending the SLA byte.

**Attention** This is a public forum