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.

MSP430F5529 I2C COMMUNICATION

Part Number: MSP430F5529

I WANT TO READ DATA FROM SPECIFIC 0X03 REGISTER OF I2C SLAVE MODULE USING MSP430F5529 BUT INSTEAD OF 16 BIT DATA WITH ACKNOWLEDGE I COULD ONLY GET 8 BIT DATA WITCH NACK.MY CODE

#include <msp430.h>
char Data_In=0;
unsigned char RXByteCtr;
unsigned char *PRxData;
volatile unsigned char RxBuffer[128];
void main(void)
{
    volatile int i;
WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT                          // P1.0 output
 P3SEL |= 0x03;                            // Assign I2C pins to USCI_B0
 UCB0CTL1 |= UCSWRST;                      // Enable SW reset
 UCB0CTL0 = UCMST + UCMODE_3 + UCSYNC;     // I2C Master, synchronous mode
 UCB0CTL1 |= UCSSEL_2;            // Use SMCLK
 UCB0BR0 = 12;                             // fSCL = SMCLK/12 = ~100kHz
 UCB0BR1 = 0;
 UCB0I2CSA = 0x40;                         // Slave Address is 048h
 UCB0CTL1 &= ~UCSWRST;                     // Clear SW reset, resume operation
UCB0IE |= UCTXIE;
UCB0IE |= UCSTPIE + UCSTTIE + UCRXIE;
volatile int c=1;
__enable_interrupt();
  while(1)
  {
     
RXByteCtr = 2;
UCB0CTL1 |= UCTR + UCTXSTT;
while (UCB0CTL1 & UCTXSTP);
UCB0CTL1 &=~UCTXSTP;
UCB0CTL1 &=~UCTR;
UCB0CTL1 |=UCTXSTT;
while (UCB0CTL1 & UCTXSTP);
UCB0CTL1 &=~UCTXSTP;
  }
    }

#pragma vector = USCI_B0_VECTOR
__interrupt void USCI_B0_ISR(void)
{
    switch(UCB0IV){
        case 0x0A:
            RXByteCtr--;                            // Decrement RX byte counter
               if (RXByteCtr)
               {
                 *PRxData++ = UCB0RXBUF;               // Move RX data to address PRxData
                 if (RXByteCtr == 1)                   // Only one byte left?
                   UCB0CTL1 |= UCTXSTP;                // Generate I2C stop condition
               }
               else
               {
                 *PRxData = UCB0RXBUF;                 // Move final RX data to PRxData
                 __bic_SR_register_on_exit(LPM0_bits); // Exit active CPU
               }
               break;
        case 0x0C:
            UCB0TXBUF = 0X01;
            break;
        default:
            break;}
}

**Attention** This is a public forum