微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 硬件电路设计 > TI模拟硬件电路设计 > ADS1220采集不了0.6mv以下的电压

ADS1220采集不了0.6mv以下的电压

时间:10-02 整理:3721RD 点击:

采用stm32驱动ads1220,ads1220连接图如图1所示,两个单端输入信号,ref+(3.298V)作为外部参考电压,但是使用采用了内部2.048V的参考电压,程序初始化时设置如下:

ADS1220_Reset(); //复位

void Setup_ADS1220 (unsigned char inputMux, unsigned char gainLevel) //初始化设置
{
unsigned char config[4];

config[0] = inputMux + gainLevel + ADS1220_PGA_BYPASS;
config[1] = ADS1220_DATA_RATE_175SPS+ ADS1220_OP_MODE_NORMAL + ADS1220_CONVERSION_SINGLE_SHOT + ADS1220_TEMP_SENSOR_OFF + ADS1220_BURN_OUT_CURRENT_OFF;
config[2] = ADS1220_FIR_50_60 + ADS1220_VREF_INTERNAL + ADS1220_LOW_SIDE_POWER_CLOSES + ADS1220_IDAC_CURRENT_OFF;
config[3] = ADS1220_IDAC1_DISABLED + ADS1220_IDAC2_DISABLED + ADS1220_DRDY_ON_DRDY_ONLY;

switch (gainLevel)
{
case ADS1220_GAIN_1:
PgaGainLevel = 1.0;
break;
case ADS1220_GAIN_2:
PgaGainLevel = 2.0;
break;
case ADS1220_GAIN_4:
PgaGainLevel = 4.0;
break;
case ADS1220_GAIN_8:
PgaGainLevel = 8.0;
break;
case ADS1220_GAIN_16:
PgaGainLevel = 16.0;
break;
case ADS1220_GAIN_32:
PgaGainLevel = 32.0;
break;
case ADS1220_GAIN_64:
PgaGainLevel = 64.0;
break;
case ADS1220_GAIN_128:
PgaGainLevel = 128.0;
break;

}
ADS1220_Write_Regs (config, ADS1220_CONFIG_0_REG, 4);
delay_us(10);
ADS1220_Read_Regs (config, ADS1220_CONFIG_0_REG, 4);
}

main函数中while(1)循环如下:

Change_ADS1220(ADS1220_MUX_AIN0_AIN1,ADS1220_GAIN_32); //设置输入端口和放大倍数
delay_ms(1);
for(i=0;i<12;i++) //采集12次,去除最大最小求均值
{
ADS1220_Start();
delay_us(1);
while(ADC_RDY_DAT);
delay_us(2);
ADS1220_Get_Conversion_Data((unsigned char *)tempData);
Databuffer[i] = ADS1220_Gain_vlotage(tempData);

这个是电压转换函数:

double ADS1220_Gain_vlotage (unsigned char *tempData)
{
volatile long temp = 0;
volatile double voltage = 0;

temp = tempData[0];
temp <<= 8;
temp |= tempData[1];
temp <<= 8;
temp |= tempData[2];

// Was temp negative?
if (tempData[0] & 0x80)
{
temp |= 0xff000000;
}

voltage =(double)temp*VREF/0x7fffff/PgaGainLevel;

return voltage;

}

其中:

void Change_ADS1220 (unsigned char inputMux, unsigned char gainLevel)
{
unsigned char config;

config = inputMux + gainLevel + ADS1220_USE_PGA ;

switch (gainLevel)
{
case ADS1220_GAIN_1:
PgaGainLevel = 1.0;
break;
case ADS1220_GAIN_2:
PgaGainLevel = 2.0;
break;
case ADS1220_GAIN_4:
PgaGainLevel = 4.0;
break;
case ADS1220_GAIN_8:
PgaGainLevel = 8.0;
break;
case ADS1220_GAIN_16:
PgaGainLevel = 16.0;
break;
case ADS1220_GAIN_32:
PgaGainLevel = 32.0;
break;
case ADS1220_GAIN_64:
PgaGainLevel = 64.0;
break;
case ADS1220_GAIN_128:
PgaGainLevel = 128.0;
break;

}
ADS1220_Write_Regs (&config, ADS1220_CONFIG_0_REG, 1);
delay_us(10);
ADS1220_Read_Regs (&config, ADS1220_CONFIG_0_REG, 1);
}

即主循环使用的是ADS1220_MUX_AIN0_AIN1端口采集输入,32倍的增益,按照2.048/2^24=0.001mV 为最低可检测到的电压,为什么输入0.3mV采集到的数据为0.001mV呢(采不准,并且更换了更大的放大倍数也一样),也就是基本采集不到?同时100mV以上采集到的电压也相差0.5mV,这是ads1220硬件连接问题还是软件问题?

是不是电路噪声太大了?或者你的输入本身就比较大的噪声?

你直接把输入接地,看看采样出来的值跳变有多大。

把输入接地时采集到的电压为0.003~0.005跳变,该怎么解决0.6mV以下测不到,及100mv以下测不准的问题呢?

这个芯片多少位分辨率?你的信号频率多少?

小电压信号传输过程有衰减。

另外需要考虑电源纹波影响!

把输入端接地采集到的电压是0.054mV,这个得怎么处理呢?是在程序中直接把采集到的电压减去0.054mv?还是硬件上怎么处理?

可能是布板或者电源噪声有影响。

你尝试做下多次平均,看能不能消除

单端输入方式吗?

对照数据手册检查是否满足共模电压范围要求。

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top