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.

[参考译文] CCS/MSP430FR2311:ADC MSP430FR2311与带有 driverlib 的外部输入不起作用

Guru**** 2386600 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/773602/ccs-msp430fr2311-adc-msp430fr2311-to-external-input-with-driverlib-does-not-work

器件型号:MSP430FR2311

工具/软件:Code Composer Studio

你好

ADC_Value 高于 1020。 即使热敏电阻的热量 增加、ADC_Value 也不会改变

电路连接不正确。

我想得到一个答案。

谢谢

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

void GPIO_ADC_init (void)

   /*GPIO 配置*/
   GPIO_setAsInputPin (GPIO_PORT_ADC7、GPIO_PIN_ADC7);
   GPIO_setPeripheralModuleFunctionInputPin (GPIO_PORT_ADC7、GPIO_PIN_ADC7、GPIO_Function_ADC7);

  }


unsigned int adc_value=0;

void get_adc (void)

   ADC_INIT (ADC_base、ADC_SAMPLEHOLDSOURCE_SC、ADC_CLOCKSOURCE_ADCOSC、ADC_CLOCKDIVIDER_1);
   ADC_ENABLE (ADC_base);
   ADC_setupSamplingTimer (ADC_base、ADC_CYCLEHOLD_16_cycles、ADC_MULTIPLESAMPLESDISABLE);
   ADC_setResolution (ADC_base、ADC_resolution_10BIT);
   ADC_configureMemory (ADC_base、ADC_INPUT_A7、ADC_VREFPOS_AVCC、ADC_VREFNEG_AVSS);
   ADC_clearInterrupt (ADC_base、ADC_completed_interrupt_FLAG);
 // adc_enableInterrupt (adc_base、adc_completed_interrupt);

void main (void)

   //停止看门狗计时器
   WDT_A_HOLD (WDT_A_base);

   GPIO_ADC_init ();

   get_adc();

   PMM_unlockLPM5 ();


  while (1)
  {
      ADC_startConversion (ADC_base、ADC_SINGLECHANNEL);
      while (!(adc_getInterruptStatus (adc_base、adc_completed_interrupt_FLAG)));
      ADC_Value = ADC_getResults (ADC_base);
      ADC_clearInterrupt (ADC_base、ADC_completed_interrupt_FLAG);
    // ADC_enableInterrupt (ADC_base、ADC_completed_interrupt)

  }

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    您好、Lee、

    我想为您推荐 ADC 的外设示例、在下面的在线文件夹中、该示例应被命名为 msp430fr231x_ADC10_xx.c:
    dev.ti.com/.../

    您可以尝试该代码并再次测试。