读了手册,看到该芯片有2路AD通道,可以设置4个采样序列。
我的疑问是:
1、是不是2路AD通道的采样序列是独立的?即ADC0有SS0~SS3四个序列可以设置,ADC1也是如此,且序列之间不会有无冲突?
例:ADCSequenceConfigure(ADC0_BASE, ADC_SS0, ADC_TRIGGER_TIMER, 0);
ADCSequenceConfigure(ADC1_BASE, ADC_SS0, ADC_TRIGGER_TIMER, 0);
这样设置会不会有问题?
2、所谓的优先级是怎么判断的?
如下代码,SS0有8个采样,优先级为0,SS1有4个采样,优先级为1。如果都是通过Timer触发,是不是SS1永远都采不到?还是只是按照优先级顺序,先处理SS0序列中的8个采样,再继续处理SS1序列中的4个采样?
ADCSequenceConfigure(ADC0_BASE, ADC_SS0, ADC_TRIGGER_TIMER, 0);
ADCSequenceStepConfigure(ADC0_BASE, ADC_SS0, ADC_STEP0, ADC_CTL_CH0);
ADCSequenceStepConfigure(ADC0_BASE, ADC_SS0, ADC_STEP1, ADC_CTL_CH1);
ADCSequenceStepConfigure(ADC0_BASE, ADC_SS0, ADC_STEP2, ADC_CTL_CH2);
ADCSequenceStepConfigure(ADC0_BASE, ADC_SS0, ADC_STEP3, ADC_CTL_CH3);
ADCSequenceStepConfigure(ADC0_BASE, ADC_SS0, ADC_STEP4, ADC_CTL_CH4);
ADCSequenceStepConfigure(ADC0_BASE, ADC_SS0, ADC_STEP5, ADC_CTL_CH5);
ADCSequenceStepConfigure(ADC0_BASE, ADC_SS0, ADC_STEP6, ADC_CTL_CH6);
ADCSequenceStepConfigure(ADC0_BASE, ADC_SS0, ADC_STEP7, ADC_CTL_CH7 | ADC_CTL_IE | ADC_CTL_END);
ADCSequenceConfigure(ADC0_BASE, ADC_SS1, ADC_TRIGGER_TIMER, 1);
ADCSequenceStepConfigure(ADC0_BASE, ADC_SS1, ADC_STEP0, ADC_CTL_CH8);
ADCSequenceStepConfigure(ADC0_BASE, ADC_SS1, ADC_STEP1, ADC_CTL_CH9);
ADCSequenceStepConfigure(ADC0_BASE, ADC_SS1, ADC_STEP2, ADC_CTL_CH10);
ADCSequenceStepConfigure(ADC0_BASE, ADC_SS1, ADC_STEP3, ADC_CTL_CH11 | ADC_CTL_IE | ADC_CTL_END);
望知道的朋友解惑,谢谢! |