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.

[参考译文] RM44L520:ADC ID 始终设置为0。

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

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1135924/rm44l520-adc-id-always-set-to-0

器件型号:RM44L520
主题中讨论的其他器件:HALCOGEN

大家好、  

从 ADC 指针获取引脚 ID 时遇到了一些问题。 现在、我使用的是 ADC1组1、并启用引脚6和引脚3。 然后、我使用以下函数将两个 ADC 捕获值分配给局部变量:  

int value1 = 0;
int value2 = 0;
adcData_t adc1_data; //ADC Data Structure
adcData_t *adc1_data_ptr = &adc1_data; //ADC Data Pointer

adcStartConversion(adcREG1, adcGROUP1); //Start ADC conversion
while(!adcIsConversionComplete(adcREG1, adcGROUP1)); //Wait for ADC conversion
adcStopConversion(adcREG1, adcGROUP1);

adcGetData(adcREG1, 1U, adc1_data_ptr); //Store conversion into ADC pointer
value1 = (unsigned int)adc1_data_ptr -> value; //Store measured value locally

adcGetData(adcREG1, 1U, adc1_data_ptr); //Store conversion into ADC pointer
value2 = (unsigned int)adc1_data_ptr -> value; //Store measured value locally

我遇到的问题是、两个捕获的 ID 似乎始终为0。 我不确定 ADC 采集过程中是否还有一些额外的步骤缺失、但如果有任何帮助、我将不胜感激。  

提前感谢您的帮助。  

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

    我现在意识到 ID 未包括在内、因为我没有选中 Halcogen 中的 Enable Channel ID in Conversion Results (在转换结果中启用通道 ID)框。 遗憾的是、现在似乎每次只执行其中一个 ADC 转换。 根据文档、我希望调用 adcGetData 函数会使用第二个 ADC 捕获值更新 ADC1_DATA_PTR、但似乎不会这样做。 有人知道这种情况的发生原因吗?  

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

    我现在看到我的问题是什么。 adcGetData 函数会提取所有排队的 ADC 和 ID 值、然后将其存储在本地。 adcGetData 函数只需要调用一次。