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.

MSP430FR4133: ADC Sequence Example Code not functioning as expected

Part Number: MSP430FR4133
Other Parts Discussed in Thread: MSP-EXP430FR4133, MSP430WARE

Hello,

I am trying to read a sequence of ADC values from A2 to A0.  I am using the msp430fr413x_adc10_10.c example provided on the TI Resource Explorer under MSP430Ware, Development Tools, and MSP-EXP430FR4133.  When I run this code and add ADC_Result to the Expressions window, I notice that only A2 is ever collected before going into a low power the mode that the device subsequently never leaves.  Can you tell how this code can be properly augmented to actually read sequentially channels A2, A1, and A0?

  • Hi Patrick,

    Unfortunately, it looks like the issue is caused because the ADC is using MODCLK as the clock source. This should be fine in LPM0, but for some reason it is not working. I will look into this, but for now, you can fix this in one of two ways:

    1. Replace line 90 with: ADCCTL1 |= ADCSHP | ADCCONSEQ_1; (this will use ACLK instead of MODCLK)
    2. Or, replace line 106 with __bis_SR_register(GIE);   (this will keep the device in active mode)

    Regards,

    Nathan

  • More generally, this example relies on having the ADC clock be slow enough (relative to MCLK) that you can snatch the MEM0 value before the next conversion in the burst completes. Since there's no DMA/DTC/multiple-MEMx-registers, you need some CPU margin. For that purpose, NathanS's suggestion to use ACLK (REFOCLK or XT1, in any case ~32kHz) will suffice -- it slows down the burst by 30x.

    In my case, I was using a timer (TB1.1) on an FR2311 to trigger the conversion. I ran the timer at 3x speed, and used CONSEQ_3 but left MSC=0. Thus each trigger stepped through the burst at the rate I chose, but the ADC was only active for short periods since it used a faster clock.

**Attention** This is a public forum