主题中讨论的其他器件: MSP430FR2422
您好!
我要将应用从 MSP430FR2422移植到 MSP430FR2522。 除 ADC 外、一切似乎都正常工作。
我使用的是两个 ADC 通道、A0和 A4。 通过调用 StartADCConversion 函数来配置通道并启动转换、我可以在通道之间切换。
然后、我在 ADC 中断上获取 ADC 读数、并将其存储在我在 StartADCConversion 函数上传递的结构中。
我遇到的问题是、当我使用其他通道启动转换时、ADC 会获取随机读数。 请注意、我在两次读数之间至少等待5毫秒。
代码在 MSP430FR2422上工作正常、因此我想知道什么与 MSP430FR2522不同。
void StartADCConversion(adc_input_vrbls_t * channel) { //Configure Memory Buffer /* * Base Address for the ADC Module * Input A6 as first multiple sample channel * Use positive reference of AVcc * Use negative reference of AVss */ ADC_configureMemory(ADC_BASE, channel->AdcChannel, ADC_VREFPOS_AVCC, ADC_VREFNEG_AVSS); adcReading = channel; //Enable and Start the conversion //in Multiple-Channels, Single Conversion Mode ADC_startConversion(ADC_BASE, ADC_SINGLECHANNEL); _BIS_SR(GIE); }