Other Parts Discussed in Thread: ADS1231, MSP430F5529, MSP430F449, ADS1232REF
Tool/software: Code Composer Studio
According to the timing diagram on p.13 of ADS1231's datasheet, the total time for all 24 bits of data to output (t_conv) should be 12.5 ms when SPEED is high, which I have configured on my ADS1231REF board. However, my oscilloscope shows the signal functioning otherwise. Why is one bit of data roughly 12.5 ms long when all 24 bits should be outputted in that duration? How can I speed up my board's data output?
Below is a picture of the oscilloscope. As you can see, the duration of one low bit is roughly 12.5 ms. Here, SCLK is running at 32,768 Hz, and all 8 pulses are generated within only 1 bit of data output. So, the data my program obtains at this clock setting is mostly 0xffffff.
When I set SCLK to roughly 80 Hz (79.92 Hz) to synchronize with the data rate of the ADS1231REF, this is the data I receive. It is very inconsistent and does not translate to the actual expected data.
DEBUG POINT: The code is 10d8dec
DEBUG POINT: The code is bd3dba
DEBUG POINT: The code is e767d5
DEBUG POINT: The code is 9b1b0f
DEBUG POINT: The code is 8f0fdc
DEBUG POINT: The code is 9f1fc2
DEBUG POINT: The code is 84048a
DEBUG POINT: The code is 1028269
DEBUG POINT: The code is 9a1a9d
DEBUG POINT: The code is df5f8a
DEBUG POINT: The code is d050db
DEBUG POINT: The code is 10f8fda
DEBUG POINT: The code is 15ddd86
DEBUG POINT: The code is ff7f47
DEBUG POINT: The code is 127a7ea
DEBUG POINT: The code is 10b8bbb
Is there a problem with my program? Below is the function in my code that gets the 24 bit code from the ADS1231.
int32_t get_Code(void)
{
int32_t code, data1, signExtension;
int16_t data2;
int8_t data3, sign;
//new data is ready to be outputted when DRDY (P7.0) goes low. then, on the first rising edge of SCLK, data is shifted out bit by bit
while (P7IN & BIT0); // exits loop when P7.0 (DRDY) goes low / new data is ready
while (!(UCB0IFG & UCTXIFG));
UCB0TXBUF = 0x21;
data1 = UCB0RXBUF;
sign = data1 >> 7;
if (sign) signExtension = 0xff;
else signExtension = 0x00;
signExtension <<= 24;
data1 = data1 << 16;
while (!(UCB0IFG & UCTXIFG));
UCB0TXBUF = 0x22;
while (!(UCRXIFG));
data2 = UCB0RXBUF;
data2 = data2 << 8;
while (!(UCB0IFG & UCTXIFG));
UCB0TXBUF = 0x23;
while (!(UCRXIFG));
data3 = UCB0RXBUF;
while (!(UCB0IFG & UCTXIFG));
UCB0TXBUF = 0x24; // 25th SCLK cycle to set DRDY high
code = data1 + data2 + data3 + 0x800000; //to make ADC codes unipolar
code &= 0x00ffffff;
printf("DEBUG POINT: The code is %04lx\n", code);
return code;
}