AdcRegs.ADCTRL1.bit.ACQ_PS = ADC_SHCLK;
AdcRegs.ADCTRL3.bit.ADCCLKPS = ADC_CKPS;
AdcRegs.ADCTRL1.bit.SEQ_CASC = 1;
AdcRegs.ADCCHSELSEQ1.bit.CONV00 = 0x1;
AdcRegs.ADCTRL1.bit.CONT_RUN = 1;
AdcRegs.ADCTRL1.bit.SEQ_OVRD = 1;
AdcRegs.ADCCHSELSEQ1.all = 0x1;
AdcRegs.ADCMAXCONV.bit.MAX_CONV1 = 0x0
// Clear SampleTable
for (i=0; i<BUF_SIZE; i++)
{
SampleTable[i] = 0;
}
// Start SEQ1
AdcRegs.ADCTRL2.all = 0x2000;
while(1)
{
while(AdcRegs.ADCST.bit.INT_SEQ1 == 0);
AdcRegs.ADCST.bit.INT_SEQ1_CLR = 1;
SampleTable[array_index++]= ( (AdcRegs.ADCRESULT0)>>4);
if(array_index>(BUF_SIZE-1)) array_index=0;
DELAY_US(100);
}
以上是我的28335的AD单通道 A1配置,但是我不明白为什么A0通道也能使用!即使我进行AD单通道 A2配置,A0通道也能使用,不知道我是哪里出错了
|