Because of the holidays, TI E2E™ design support forum responses will be delayed from Dec. 25 through Jan. 2. Thank you for your patience.

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.

MSP430FR5969-SP: Read 24 bits via SPI with the MSP430FR5969-SP

Part Number: MSP430FR5969-SP
Other Parts Discussed in Thread: ADS1278

The UCA0RXBUF of MSP430FR5969-SP is only 8 bit large.

I need to read 24 bits from an ADC. How can I achieve this via interrupts, so I only read the register once all the data is ready? I would need at least 3x 8 bit rx buffers, but I only have 1x 8 bit.

Best Regards

  • Hi,

    you need to read the data 8bit wise. That's the nature of e.g. SPI or UART.

    It does not matter, that the ADC (assume you're talking about an external ADC with SPI interface) is transmitting 24Bit in a sequence, I assume. After the first 8 bit, the SPI RX buffer on the MSP430 side will be full and trigger an RX interrupt, of course after correct configuration of the module on the MSP430, and than you have time until the reception of the next 8 bit to store the first byte in a variable. The same procedure than with the second and 3rd. After the third, or even during the reception of second and third, you can shift the previously received 1st and 2nd byte by respective number of bits, and assemble this way finally after the reception of the 3rd byte the 24bit value from the ADC.

    In our Code Composer Studio, and its code examples within the TI Resource Explorer you can find SPI examples, showing how to configure the SPI interface for reception.

    Best regards

    Peter

  • Hello,

    please let us know, whether you need further support on this topic. Many thanks in advance.

    Best regards

    Peter

  • Hello,

    Since you are working with the FR5969-SP and the data size is 24 bits am I correct in assuming the ADC is the ADS1278-SP?

    Peter provided a good solution, but I thought I would suggest another technique if you do only want to trigger an interrupt after the 24bits have been read. The FR5969 has a 3-channel DMA controller; this can be set up in repeated single byte-to-byte transfer mode from the RXBUF to some location in memory. The trigger for the transfer would be the appropriate eUSCI RX Flag. Setting a transfer size of 3 bytes (or 3*NumChannels) will only trigger the DMA interrupt after all the data has been read. 

    If you are working with the ADS1278 this technique also works well at the high SPI speeds you may want to be operating at.

    Regards,

    Nathan

  • Dear Nathan,

    thank you very much for your recommendation. Your solution is exactly what I was looking for!

    Regards,

    Tamás

**Attention** This is a public forum