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.

MSP430G2553: Access multiple ADC channels without delaying MCU operation

Genius 16520 points
Part Number: MSP430G2553

Hi Experts,

Good day. Seeking your assistance on this query from Cx, posting this on his behalf.

This link is helpful, 

Question, how can I use the same scheme to sample multiple ADC channels? Is there any sample code.guide for this?

Thank you.

Regards,
Archie A.

  • The short answer is: Use CONSEQ=3 rather than CONSEQ=2 (with MSC=1). This will add new complications:

    1) With CONSEQ=3 (or =1) the ADC10 counts channels down from INCH. The referenced thread uses INCH=10, so you would get 11 conversions (A10->A0) each cycle. This doesn't hurt the unused channels (not reflected in AE0) but you do have to allow space/time for the extra conversions.

    2) Since there's only one MEM register, you will not succeed in fetching the results as fast as they arrive. You'll want to use the DTC (a bespoke DMA engine) to put them in your own array.

    The nearest match in the TI Examples is probably msp430g2x33_adc10_14.c here:

    https://dev.ti.com/tirex/explore/node?node=ACEuPdRDfguvAkgIDxhY1w__IOGqZri__LATEST

    Glancing over the adc10_14 code, an Unsolicited suggestion is to not do this:

    >  ADC10SA = 0x200; // Data buffer start

    which effectively allocates a 32-word array at the beginning of SRAM without telling the linker. This will work in this Example (since there are no global variables) but doesn't scale. Instead, declare an honest array and assign that:

    > unsigned results[0x20];   // DTC sink (0x20 from DTC1 settinng above)

    > ADC10SA = (unsigned)&results[0]; // Data buffer start

**Attention** This is a public forum