新闻中心

EEPW首页>测试测量>设计应用> 测量差分输出、电流模式数/模转换器(DAC)的线性度

测量差分输出、电流模式数/模转换器(DAC)的线性度

作者: 时间:2017-02-27 来源:网络 收藏




表3. 5-4-3体系结构的12位编码组



定义了编码组后,必须解决采集测量点的问题。适合这类测量的万用表是Agilent? 3458,分辨率高达8.5位。该表连接在MAX5891的OUTP和OUTN端之间,输出端以50Ω负载接地。当DAC设置为20mA满量程电流时,万用表输入得到的电压摆幅是±1V。

万用表量程设置为固定的1.2V,使用最大分辨率,得到10nV最小测量结果。切换表的量程会增大测量值的增益误差;因此,使用单电压量程可以避免其他的误差源。由于需要锁存数字输入,MAX5891还需要时钟信号。一旦连接好了万用表、时钟源、电源和数字输入控制,就可以采集线性度测量点。

采集所有测量点后,需要画出重建后的DAC输出传输函数。由于对每一电流源都进行了测量,很容易产生对应于所有编码的传输函数。例如,考虑器件的4个LSB。我们测量编码0x8000、0x8001、0x8002、0x8004和0x8008。对于编码0x8000,LSB计算的基准是DAC量程中部。LSB权重是在0x8001测得的电压值减去在0x8000测得的电压值。

在0x8001和0x8780之间测量的所有编码采用相同的公式。0x0800到0xF800的其他点是MSB电流源,以编码0x0000为基准进行计算。考虑编码0x4F31作为各种电流相加的例子。

首先,我们需要确定哪一测量点什么时候相加能够等于实例编码。0x4800是小于目标编码的最大MSB。从0x4F31中减去0x4800后的余数为0x0331。编码0x0300是可以减掉的次最大编码(0x8300 - 0x8000),随后是0x0030 (0x8030 - 0x8000),最后是0x0001 (0x8001 - 0x8000)。

因此,可以采用下面的等式来表示编码0x4F31的电压值:

[V(0x4800) - V(0x0000)] + [V(0x8300) - V(0x8000)] + [V(0x8030) - V(0x8000)] + [V(0x8001) - V(0x8000)](公式1)

使用相似的等式,可以计算任意给定输入编码的电压值。利用MATLAB?或Excel?软件等工具可以很容易地计算所有编码的电压,重建全部的DAC传输。

一旦建立了传输函数,就可以计算线性度。第一步是根据传输函数的端点计算LSB的电压值(端点法)。

VLSB = [V(0xFFFF) - V(0x0000)]/[2N - 1](公式2)

其中

N是器件分辨率 (16、14或者12位)

V(0x0000)是测得的DAC零标输出电压。

V(0xFFFF)是测得的DAC满幅输出电压。

采用下面的等式来计算任意给定编码的INL:

INLCODE(LSB) = [VCODE - (CODE × VLSB)]/VLSB(公式3)

其中

CODE是要计算的数字编码。

VLSB是公式2中计算的电压值。

VCODE是计算的DAC输出电压值。

下面的等式用于计算任意给定编码的DNL:

DNLCODE(LSBs) = [VCODE - VCode-1 - VLSB]/VLSB(公式4)

其中

CODE是要计算的数字编码。

VCODE是针对CODE计算的DAC输出电压值。

VCODE-1是针对CODE - 1计算的DAC输出电压值。

VLSB是公式2中计算的电压值。

以下举例说明利用MATLAB脚本计算MAX5889、MAX5890和MAX5891的线性度。每次计算都得到最小和最大DNL和INL误差编码和误差值。实例还为所有编码画出了传输函数,得到INL和DNL。要求用户输入前面表格中所列出编码的电压测量值。必须按照所列顺序输入数值。

计算16位线性度的MATLAB脚本

function Lin16(Measurements)
%Calculate INL and DNL of a 16-bit device with a 5-4-3-4 segmentation architecture
% DACCodes is the range of possible input data to the 16-bit DAC
DACCodes=[0:65535]’;
%VOUT for each code is calculated from the measured points
%create a VOUT variable and fill it with zeros
VOUT=zeros(size(DACCodes));
%The first measurement is the zero-scale point, or code (0x0000)
ZS=Measurements(1);
VOUT(1)=ZS;
%The last measurement is the full-scale point, or code (0xFFFF)
FS=Measurements(length(Measurements));
VOUT(65536)=FS;
%Midscale is stored at position 43 of the input data array
MS=Measurements(43);
%The device has four segmentation levels
Segments=4;
%The decimal values for the LSB codes are 1, 2, 4 and 8
Seg1Codes=[1;2;4;8];
%The voltages for the LSBs are in positions 2-5 of the input array
for i=1:4
Seg1V(i)=Measurements(i+1)-MS;
end
%The second level of segmentation is controlled with input codes 16 through
%112 in steps of 16. Create the code array and fill the measurements for
%this segmentation level
Seg2Codes=[16:16:16*7]’;
for i=1:7
Seg2V(i)=Measurements(i+5)-MS;
end
%Segmentation level 3 uses input codes 128 through 1920 in steps of 128.
%Create the code array and fill the measurements array.
Seg3Codes=[128:128:128*(2^4-1)]’;
for i=1:15
Seg3V(i)=Measurements(i+12)-MS;
end
%Segmentation level 3 uses input codes 2048 through 63,488 in steps of 2048.
%Create the code array and fill the measurements array.
Seg4Codes=[2048:2048:2048*(2^5-1)]’;
for i=1:31
Seg4V(i)=Measurements(i+27)-ZS;
end
%The endpoints have been defined, now fill in the voltages for the
%remaining points of the DAC transfer function.
for i = 2:65535
targetcode=i-1;
VOUT(i)=ZS;
for s=31:-1:1
if Seg4Codes(s)<=targetcode
targetcode=targetcode-Seg4Codes(s);
VOUT(i)=VOUT(i)+Seg4V(s);
s=0;
end
end
for s=15:-1:1
if Seg3Codes(s)<=targetcode
targetcode=targetcode-Seg3Codes(s);
VOUT(i)=VOUT(i)+Seg3V(s);
s=0;
end
if targetcode==0
s=0;
end
end
for s=7:-1:1
if Seg2Codes(s)<=targetcode
targetcode=targetcode-Seg2Codes(s);
VOUT(i)=VOUT(i)+Seg2V(s);
s=0;
end
if targetcode==0
s=0;
end
end
if targetcode==0
s=0;
end
for s=4:-1:1
if Seg1Codes(s)<=targetcode
targetcode=targetcode-Seg1Codes(s);
VOUT(i)=VOUT(i)+Seg1V(s);
end
end
end
%Plot the transfer function
figure(1)
plot(DACCodes, VOUT);
xlabel(‘DAC Input Code’);
ylabel(‘Measured Voltage’);
axis([0 65536 -1.1 1.1]);
title(‘DAC Transfer Function’);
set(gca,’XTick’,0:16384:65536)
%Calculate the linearity
LSB=(max(VOUT)-min(VOUT))/65535;
INL(1)=0;
DNL(1)=0;
for i=2:65536
INL(i)=(VOUT(i)-(VOUT(1)+(i-1)*LSB))/LSB;
DNL(i)=(VOUT(i)-VOUT(i-1)-LSB)/LSB;
end
%Plot INL
figure(2)
plot(DACCodes, INL);
title(‘DAC Integral Linearity’);
xlabel(‘DAC Input Code’);
ylabel(‘INL (LSBs)’);
axis([0 65536 min(INL)*1.1 max(INL)*1.1]);
set(gca,’XTick’,0:16384:65536)
%Plot DNL
figure(3)
plot(DACCodes, DNL);
title(‘DAC Differential Linearity’);
xlabel(‘DAC Input Code’);
ylabel(‘DNL (LSBs)’);
axis([0 65536 min(DNL)*1.1 max(DNL)*1.1]);
set(gca,’XTick’,0:16384:65536)
txtstr=sprintf(‘INL MAX = %f’, max(INL));
disp (txtstr);
txtstr=sprintf(‘INL MIN = %f’, min(INL));
disp (txtstr);
txtstr=sprintf(‘DNL MAX = %f’, max(DNL));
disp (txtstr);
txtstr=sprintf(‘DNL MIN = %f’, min(DNL));
disp (txtstr);






16位脚本产生的曲线


上一页 1 2 下一页

关键词:测量DAC电

评论


技术专区

关闭