28377的ad用的是16位模式,文档说只能用差分模式,我在设置里设了单端模式,貌似也能用,有什么隐患吗,硬件也是单端输入的
EALLOW;
AdcaRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4
AdcSetMode(ADC_ADCA, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_SINGLE);
AdcbRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4
AdcSetMode(ADC_ADCB, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_SINGLE);
AdccRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4
AdcSetMode(ADC_ADCC, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_SINGLE);
AdcdRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4
AdcSetMode(ADC_ADCD, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_SINGLE);
Ricardo Li:
差分端口你只接了一个?另一个接地了吗?差分端实际上是两个端口之间的差分电压,要是其中一个端口悬空,那实际测得的数据就不一定准确了。
28377的ad用的是16位模式,文档说只能用差分模式,我在设置里设了单端模式,貌似也能用,有什么隐患吗,硬件也是单端输入的
EALLOW;
AdcaRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4
AdcSetMode(ADC_ADCA, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_SINGLE);
AdcbRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4
AdcSetMode(ADC_ADCB, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_SINGLE);
AdccRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4
AdcSetMode(ADC_ADCC, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_SINGLE);
AdcdRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4
AdcSetMode(ADC_ADCD, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_SINGLE);
user3971899:
回复 Ricardo Li:
做的时候本来想用16位采样,结果没注意文档说要全差分,用了伪差分接法,另一个脚接了个固定电平,这样不知道行不行??
28377的ad用的是16位模式,文档说只能用差分模式,我在设置里设了单端模式,貌似也能用,有什么隐患吗,硬件也是单端输入的
EALLOW;
AdcaRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4
AdcSetMode(ADC_ADCA, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_SINGLE);
AdcbRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4
AdcSetMode(ADC_ADCB, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_SINGLE);
AdccRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4
AdcSetMode(ADC_ADCC, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_SINGLE);
AdcdRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4
AdcSetMode(ADC_ADCD, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_SINGLE);
Ricardo Li:
回复 user3971899:
可以的,只要你的固定电平很稳定,不会因为抖动对采集信号造成影响就行。
28377的ad用的是16位模式,文档说只能用差分模式,我在设置里设了单端模式,貌似也能用,有什么隐患吗,硬件也是单端输入的
EALLOW;
AdcaRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4
AdcSetMode(ADC_ADCA, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_SINGLE);
AdcbRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4
AdcSetMode(ADC_ADCB, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_SINGLE);
AdccRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4
AdcSetMode(ADC_ADCC, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_SINGLE);
AdcdRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4
AdcSetMode(ADC_ADCD, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_SINGLE);
user3971899:
回复 Ricardo Li:
EALLOW;AdcaRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4AdcSetMode(ADC_ADCA, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_SINGLE);AdcbRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4AdcSetMode(ADC_ADCB, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_SINGLE);AdccRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4AdcSetMode(ADC_ADCC, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_SINGLE);AdcdRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4AdcSetMode(ADC_ADCD, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_SINGLE);
配置成以上单端模式是可以 ,但是配置成以下差分模式,读寄存器的值就不准了,怀疑是不是与其文档中说的16位模式共模输入电压范围有关??
EALLOW;AdcaRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4AdcSetMode(ADC_ADCA, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_DIFFERENTIAL);AdcbRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4AdcSetMode(ADC_ADCB, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_DIFFERENTIAL);AdccRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4AdcSetMode(ADC_ADCC, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_DIFFERENTIAL);AdcdRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4AdcSetMode(ADC_ADCD, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_DIFFERENTIAL);
28377的ad用的是16位模式,文档说只能用差分模式,我在设置里设了单端模式,貌似也能用,有什么隐患吗,硬件也是单端输入的
EALLOW;
AdcaRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4
AdcSetMode(ADC_ADCA, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_SINGLE);
AdcbRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4
AdcSetMode(ADC_ADCB, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_SINGLE);
AdccRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4
AdcSetMode(ADC_ADCC, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_SINGLE);
AdcdRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4
AdcSetMode(ADC_ADCD, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_SINGLE);
Ricardo Li:
回复 user3971899:
ADC input signal common mode voltage VREFCM – 50 mV 到 VREFCM + 50 mV
你要是使用单端模式就跟那个固定电平没关系了,那就是单端测量了。要是使用差分模式,会受到另一端的固定电平的影响,测出来的值是输入信号和固定电平的差值,输入信号的共模电压要满足上边的范围。
28377的ad用的是16位模式,文档说只能用差分模式,我在设置里设了单端模式,貌似也能用,有什么隐患吗,硬件也是单端输入的
EALLOW;
AdcaRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4
AdcSetMode(ADC_ADCA, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_SINGLE);
AdcbRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4
AdcSetMode(ADC_ADCB, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_SINGLE);
AdccRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4
AdcSetMode(ADC_ADCC, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_SINGLE);
AdcdRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4
AdcSetMode(ADC_ADCD, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_SINGLE);
user3971899:
回复 Ricardo Li:
我理解的是这个16位模式得用差分运放输出接入,你的意思是用单端接入也可以啊??