Part Number: MSP430F5529
Other Parts Discussed in Thread: ADS1100
Tool/software: Code Composer Studio
here is the initialization function call and the function
TI_USCI_I2C_receiveinit(0x48,0x12);
void TI_USCI_I2C_receiveinit(unsigned char slave_address,
unsigned char prescale){
P3SEL |= SDA_PIN + SCL_PIN; // Assign I2C pins to USCI_B0
UCB0CTL1 = UCSWRST; // Enable SW reset
UCB0CTL0 = UCMST + UCMODE_3 + UCSYNC; // I2C Master, synchronous mode
UCB0CTL1 = UCSSEL_2 + UCSWRST; // Use SMCLK, keep SW reset
UCB0BR0 = prescale; // set prescaler
UCB0BR1 = 0;
UCB0I2CSA = slave_address; // set slave address
UCB0CTL1 &= ~UCSWRST; // Clear SW reset, resume operation
UCB0IE = UCNACKIE;
UCB0IE = UCRXIE; // Enable RX interrupt
}
after that the receive function gets called and here is function for that
TI_USCI_I2C_receive(3,array2);
void TI_USCI_I2C_receive(unsigned char byteCount, unsigned char *field){
TI_receive_field = field;
if ( byteCount == 1 ){
byteCtr = 0 ;
__disable_interrupt();
UCB0CTL1 |= UCTXSTT; // I2C start condition
while (UCB0CTL1 & UCTXSTT); // Start condition sent?
UCB0CTL1 |= UCTXSTP; // I2C stop condition
__enable_interrupt();
} else if ( byteCount > 1 ) {
byteCtr = byteCount - 2 ;
UCB0CTL1 |= UCTXSTT; // I2C start condition
} else
while (1); // illegal parameter
}
If anyone would be able to help me out with my problem with i2c would be greatly appreciated.above are 2 pictures to help explain my problem.After the first byte is received the data line just stays high . The left one is what i get with the MSP430F5529 and the right one is what i get with an arduino that i tried with some example code for debugging purposes. And i believe that its more like what i should be getting.does anyone know what i am doing wrong yet or have example code that i should try? If you want the header file or the c file just let me know.


