TI中文支持网
TI专业的中文技术问题搜集分享网站

AD采样,定时器触发问题

现将AD配置成定时器1触发采样,定时器1配置成20us

CpuTimer0Regs.PRD.all = mSec1;             // A tasks (1ms)
CpuTimer1Regs.PRD.all = mSec0_02;       // B tasks (20us)
CpuTimer2Regs.PRD.all = mSec60;          // C tasks (60ms)

EALLOW;
AdcRegs.ADCCTL2.bit.ADCNONOVERLAP = 1;     // Enable non-overlap mode
AdcRegs.ADCCTL1.bit.INTPULSEPOS = 1;            // ADCINT1 trips after AdcResults latch
AdcRegs.INTSEL1N2.bit.INT1E = 1;                       // Enabled ADCINT1
AdcRegs.INTSEL1N2.bit.INT1SEL = 1;                   // setup EOC1 to trigger ADCINT1 to fire
AdcRegs.ADCSOC0CTL.bit.CHSEL = 4;                // set SOC0 channel select to ADCINA4
AdcRegs.ADCSOC1CTL.bit.CHSEL = 2;                // set SOC1 channel select to ADCINA2
AdcRegs.ADCSOC0CTL.bit.TRIGSEL = 2;             // set SOC0 start trigger on Timer1,
AdcRegs.ADCSOC1CTL.bit.TRIGSEL = 2;             // set SOC1 start trigger on Timer1
AdcRegs.ADCSOC0CTL.bit.ACQPS = 6;               // set SOC0 S/H Window to 7 ADC Clock Cycles, (6 ACQPS plus 1)
AdcRegs.ADCSOC1CTL.bit.ACQPS = 6;               // set SOC1 S/H Window to 7 ADC Clock Cycles, (6 ACQPS plus 1)
EDIS;

但发现如果这样配置另外两个定时器就运行不正常了,根本不按设定的定时,请问是什么原因?

Young Hu:

您好!如何测试另外两个定时器运行不正常的?不会相互影响的!

赞(0)
未经允许不得转载:TI中文支持网 » AD采样,定时器触发问题
分享到: 更多 (0)