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.

ADC10 TO ADC12 MSP430F449. HELP!

Other Parts Discussed in Thread: MSP430F1232, MSP430F449, MSP430WARE

Hey there, i need someone to help me out PLEASE!  the original board was the MSP430F1232 and I want to convert the code to the MSP430F449. I have done good job so far but I'm having a hard time using the ADC12 because the orginal code used the ADC10. I'm having a very hard time understanding how to implement the ADC12. If anyone can help me out, I would greatly appreciate it.


This is the code using the ADC10

while (ADC10CTL & BUSY) {}

ADC10DTCO |= ADC10CT;

ADC10DTC1=3;

ADC10SA = (unsigned int) AdcData;

ADC10CTL0 |=ENC;

  • Hi Frantz,

       Have you seen the code examples available for the F449 contained in MSP430Ware?  That would be a great place to start.

     

     

         MSP430Ware is included with Code Composer Studio v5.3, or you can download it here: http://www.ti.com/tool/msp430ware

        Best,

              Rick Nardone

     

      

        

     

  • The ADC10 has only one result register. To allow a sequence of conversions to be done, it includes sort of a DMA controller that can move teh results from the result register to memory.

    The ADC12 has 16 result registers and when started in sequence mode, it will put each result of the sequence into a different result register. Also, most MSPs with an ADC12 do have a full-featured DMA controlelr which can take the part of moving results in repeated single conversion mode. Or you set up the ADC12 to sample the same channel into all 16 result registers.

    What the code above does is setting up the DTC to transfer all ADC10 results to the same three locations starting at AdcData. So the first result goes to AdcData[0], the second to AdcDate[1], the third to AdcDate[2] and the fourth again to AdcData[0] and so on.

    YOu can do the same with the ADC1 2 by setting up a sequence which starts with ADC12MCTL0 and ends with ADC12MCTL2 (EOS bit set). then the ADc12 will sample the same channel in repeated sequence mode over and over again, putting the results to ADC12MEM0, ADC12MEM1 and ADC12MEM2 in an endless cycle. You don't even need the AdcData array.
    But you can define
    unsigned int const * AdcData = &ADC12MEM0;
    to have the very same effect.

  • Thank you both for you input. It is greatly appreciated.

**Attention** This is a public forum