大家好,请问一下怎么读取两通道的AD转换的值? 程序片段: SysCtlClockSetSYSCTL_SYSDIV_10|SYSCTL_USE_PLL|SYSCTL_OSC_MAIN|SYSCTL_XTAL_6MHZ); SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC); SysCtlADCSpeedSet(SYSCTL_ADCSPEED_125KSPS); ADCSequenceDisable(ADC_BASE, 0); ADCSequenceConfigure(ADC_BASE, 0, ADC_TRIGGER_PROCESSOR, 0); ADCSequenceStepConfigure(ADC_BASE, 0, 0,ADC_CTL_CH0); ADCSequenceStepConfigure(ADC_BASE, 0, 1,ADC_CTL_CH1|ADC_CTL_END); ADCSequenceEnable(ADC_BASE, 0);
while( !(HWREG(ADC_BASE + ADC_O_X_SSFSTAT) & 0x00000100) ) { ADCSequenceDataGet(ADC_BASE, 0, &ulData); Value[k]=ulData; k++; if(k>=2) {k=0;} } 这个循环好像跳不出来啊
|