AdcRegs.INTSEL1N2.bit.INT1SEL = 8; //setup EOC5 to trigger ADCINT1 to fire,SOC5转换完成产生中断
AdcRegs.ADCSAMPLEMODE.bit.SIMULEN0 = 0; //SOC0,SOC1 SEQUENTIAL Sampling Enable //顺序采样
AdcRegs.ADCSAMPLEMODE.bit.SIMULEN2 = 0; //SOC2,SOC3 SEQUENTIAL Sampling Enable
AdcRegs.ADCSAMPLEMODE.bit.SIMULEN4 = 0; //SOC4,SOC5 SEQUENTIAL Sampling Enable
AdcRegs.ADCSAMPLEMODE.bit.SIMULEN6 = 0;
AdcRegs.ADCSAMPLEMODE.bit.SIMULEN8 = 0;
AdcRegs.ADCSOC0CTL.bit.CHSEL = 7; //SOC0 ADCINA1 //ADCINA7
AdcRegs.ADCSOC1CTL.bit.CHSEL = 8; //SOC0 ADCINA1 //ADCINB0
AdcRegs.ADCSOC2CTL.bit.CHSEL = 9; //SOC0 ADCINA1 //ADCINB1
AdcRegs.ADCSOC3CTL.bit.CHSEL = 10; //SOC0 ADCINA1 //ADCINB2
AdcRegs.ADCSOC4CTL.bit.CHSEL = 11; //SOC0 ADCINA1 //ADCINB3
AdcRegs.ADCSOC5CTL.bit.CHSEL = 12; //SOC0 ADCINA1 //ADCINB4
AdcRegs.ADCSOC6CTL.bit.CHSEL = 14; //SOC0 ADCINA1 //ADCINB6
AdcRegs.ADCSOC7CTL.bit.CHSEL = 15; //SOC0 ADCINA1 //ADCINB7
AdcRegs.ADCSOC8CTL.bit.CHSEL = 6; //ADCINA6
AdcRegs.ADCSOC0CTL.bit.TRIGSEL = 0x00; //ADCTRIG0- Software only
AdcRegs.ADCSOC1CTL.bit.TRIGSEL = 0x00; //ADCTRIG0- Software only
AdcRegs.ADCSOC2CTL.bit.TRIGSEL = 0x00; //ADCTRIG0- Software only
AdcRegs.ADCSOC3CTL.bit.TRIGSEL = 0x00; //ADCTRIG0- Software only
AdcRegs.ADCSOC4CTL.bit.TRIGSEL = 0x00; //ADCTRIG0- Software only
AdcRegs.ADCSOC5CTL.bit.TRIGSEL = 0x00; //ADCTRIG0- Software only
AdcRegs.ADCSOC6CTL.bit.TRIGSEL = 0x00; //ADCTRIG0- Software only
AdcRegs.ADCSOC7CTL.bit.TRIGSEL = 0x00; //ADCTRIG0- Software only
AdcRegs.ADCSOC8CTL.bit.TRIGSEL = 0x00; //ADCTRIG0- Software only
//Sample window is 7 cycles long (6 + 1 clock cycles).
AdcRegs.ADCSOC0CTL.bit.ACQPS = 6;
AdcRegs.ADCSOC1CTL.bit.ACQPS = 6;
AdcRegs.ADCSOC2CTL.bit.ACQPS = 6;
AdcRegs.ADCSOC3CTL.bit.ACQPS = 6;
AdcRegs.ADCSOC4CTL.bit.ACQPS = 6;
AdcRegs.ADCSOC5CTL.bit.ACQPS = 6;
AdcRegs.ADCSOC6CTL.bit.ACQPS = 6;
AdcRegs.ADCSOC7CTL.bit.ACQPS = 6;
AdcRegs.ADCSOC8CTL.bit.ACQPS = 6;
Green Deng:
你好,还请说明一下使用的是哪款芯片?
,
user6620123:
TMS320F2803x 我想知道为什么会发生这种情况,还有如果设置SOC8,应该怎么修改,谢谢
,
Green Deng:
尝试一下把上述程序
user6620123 说:
AdcRegs.ADCSOC0CTL.bit.CHSEL = 7; //SOC0 ADCINA1 //ADCINA7
AdcRegs.ADCSOC1CTL.bit.CHSEL = 8; //SOC0 ADCINA1 //ADCINB0 AdcRegs.ADCSOC2CTL.bit.CHSEL = 9; //SOC0 ADCINA1 //ADCINB1 AdcRegs.ADCSOC3CTL.bit.CHSEL = 10; //SOC0 ADCINA1 //ADCINB2 AdcRegs.ADCSOC4CTL.bit.CHSEL = 11; //SOC0 ADCINA1 //ADCINB3 AdcRegs.ADCSOC5CTL.bit.CHSEL = 12; //SOC0 ADCINA1 //ADCINB4 AdcRegs.ADCSOC6CTL.bit.CHSEL = 14; //SOC0 ADCINA1 //ADCINB6 AdcRegs.ADCSOC7CTL.bit.CHSEL = 15; //SOC0 ADCINA1 //ADCINB7
AdcRegs.ADCSOC8CTL.bit.CHSEL = 6; //ADCINA6
替换成
AdcRegs.ADCSOC0CTL.bit.CHSEL = 7;AdcRegs.ADCSOC1CTL.bit.CHSEL = 7;AdcRegs.ADCSOC2CTL.bit.CHSEL = 8;AdcRegs.ADCSOC3CTL.bit.CHSEL = 9;AdcRegs.ADCSOC4CTL.bit.CHSEL = 10;AdcRegs.ADCSOC5CTL.bit.CHSEL = 11;AdcRegs.ADCSOC6CTL.bit.CHSEL = 12;AdcRegs.ADCSOC7CTL.bit.CHSEL = 14;AdcRegs.ADCSOC8CTL.bit.CHSEL = 15;测试一下是否有效。其他问题暂时没看出来
,
Green Deng:
如果方便的话可以把工程转压缩文件后上传一下