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.

请教有关AD转换结果的保存。



大家好:

        我配置了将ADC的结果,保存于ADC12MEM1中,可是得到的值始终是0,还望大家不吝赐教。

下面是我的相关配置:

ADC12CTL0 = ADC12SHT0_8 + ADC12REFON + ADC12ON;     // Internal ref = 1.5V                                               

ADC12CTL1 = ADC12SHP  + ADC12CSTARTADD1;                   // enable sample timer    

ADC12MCTL1 = ADC12SREF_1 + ADC12INCH_10 + ADC12EOS;     // ADC i/p ch A10 = temp sense i/p    

 ADC12CTL2 = ADC12RES1;   

  __delay_cycles(37);                                                                      // delay to allow Ref to settle    

 ADC12CTL0 |= ADC12ENC + ADC12SC ;        

while((ADC12IFG1 & BIT1)!= BIT1) ;                    

 temp = ((ADC12MEM1 - 2438) * 410) / 4096.0 - 8.2);   

在此先谢谢大家了!