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.

MSP430FR5739 ADC的问题

Other Parts Discussed in Thread: MSP430FR5739

设置为

// Configure ADC10 - Pulse sample mode; ADC10SC trigger    

 ADC10CTL0 &= ~ADC10ENC;                        // Ensure ENC is clear    

ADC10CTL0 = ADC10SHT_5 + ADC10ON;         // 16 ADC10CLKs; ADC ON    

ADC10CTL1 = ADC10SHP + ADC10CONSEQ_0;     // s/w trig, single ch/conv    

ADC10CTL2 = ADC10RES;                     // 10-bit conversion results    

ADC10MCTL0 = ADC10SREF_1 + ADC10INCH_11;  // AVcc/2            // Configure internal reference    

while(REFCTL0 & REFGENBUSY);              // If ref generator busy, WAIT    

 REFCTL0 |= REFVSEL_1+REFON;                    

 __delay_cycles(10000);                      // Delay for Ref to settle

 

 VccValue = (10*ADC10MEM0)>>8;

 

而数据手册里看到Nadc=1023*(Vin-Vr-)/Vr+-Vr-

Vin=ADC10MEM0*2/1024  才对,为什么例子里剩10再除256。应该直接可除512

  • xinglong qi1,

    看程序,你ADC的参考电压选择的是内部REF, 2.0V, 我认为你的算法是正确的,Vin=ADC10MEM0*2/1023。请问你的例程是哪里来的?我查看了MSP430Ware中对应的例程,没有你这个例程的。

    希望对你有帮助!O(∩_∩)O~

  • 这个例子是Home Automation Application里的,CC3000+MSP430FR5739的板,这ADC应该和CC3000没有关系。

  • xinglong qi1,

    我看了在你的ADC设置中,你选的是ADC的A11 channel,是用作Batt.Monitor的,检测(AVCC – AVSS) / 2,故最后计算时:

    Vcc/2 = Vin=ADC10MEM0*2/1023, 故Vcc=ADC10MEM0/256, 而*10是为了扩大10倍,得到更高精度的电压值。

    VccValue = (10*ADC10MEM0)>>8; 得到的结果是Vcc*10.

    希望对你有帮助!