主题中讨论的其他器件:ADS1203
各位专家、您好!
我的客户使用 SINCFAST 滤波器、OSR=128、 Sdfm1Regs.SDDPARM2.bit.SH=1。 当 AMC1306的输入为 -250mV~250mV 时、您会发现 数据波动很大。 他们认为、对于 SINCFAST 滤波器、OSR=128、数据范围为 -32768~32767、在16位数据范围内、不需要运行移位寄存器。 对吗?
第二 个问题是选择 SINC3滤波器时、在与 SINCFAST 滤波器类型相同的条件下、数据波动很大。 以下是 测量结果:
选择 SINC3滤波器时 、OSR=32、移位寄存器0、amc1306调制器输入250mV 信号、理论数据为25598、但实际数据范围为28389到28553。
代码如下:
EALLOW;
EPwm5Regs.TBPHS.ALL = 0;
EPwm5Regs.TBCTL.ALL = 0xc000;
EPwm5Regs.CMPCTL.ALL = 0x0;
EPwm5Regs.CMPCTL2.ALL = 0x0;
EPwm5Regs.AQCSFRC.ALL = 0x0; //强制禁用
/*动作限定符输出 A 控制寄存器*/
EPwm5Regs.AQCTLA.ALL = 0x0003;
/*Action 限定符输出 A2控制寄存器*/
EPwm5Regs.AQCTLA2.ALL = 0;
/*什么也不做*/
/*Action 限定符输出 B 控制寄存器*/
EPwm5Regs.AQCTLB.all = 0;
/*什么也不做*/
/*Action 限定符输出 B2控制寄存器*/
EPwm5Regs.AQCTLB2.ALL = 0;
/*什么也不做*/
/*死区发生器控制寄存器*/
EPwm5Regs.DBCTL.ALL = 0x0007;
/*Event-Trigger 选择寄存器*/
EPwm5Regs.ETSEL.ALL = 0x0;
/*事件触发 预分频 寄存器*/
EPwm5Regs.ETPS.ALL = 0x0;
/*时基周期寄存器*/
//EPwm5Regs.TBPRD = 4;// 10M 100M/10M/2 - 1 = 4
EPwm5Regs.TBPRD = 2;// 16.67M 100M/(2 + 1)/2 = 16M
//IU Σ-Δ ADC
Sdfm1Regs.SDDFPARM2.bit.DOSR = 128;
Sdfm1Regs.SDDFPARM2.bit.st = 0;
Sdfm1Regs.SDDFPARM2.bit.Fen = 1;
Sdfm1Regs.SDDPARM2.bit.DR = 0;
Sdfm1Regs.SDDPARM2.bit.SH = 0;
//iw Σ-Δ ADC
Sdfm1Regs.SDDFPARM4.bit.DOSR = 128;
Sdfm1Regs.SDDFPARM4.bit.st = 0;
Sdfm1Regs.SDDFPARM4.bit.Fen = 1;
Sdfm1Regs.SDDPARM4.bit.DR = 0;
Sdfm1Regs.SDDPARM4.bit.SH = 0;
//比较器(二次)滤波器单元 配置
//0-32768
Sdfm1Regs.SDCPARM2.bit.COSR = 31;
//Sinc3.
Sdfm1Regs.SDCPARM2.bit.CS1_CS0 = 3;
Sdfm1Regs.SDCPARM2.bit.CEN = 1;
Sdfm1Regs.SDCPARM2.bit.IEH=1;
Sdfm1Regs.SDCPARM2.bit.IEL = 1;
Sdfm1Regs.SDCPARM4.bit.COSR = 31;
Sdfm1Regs.SDCPARM4.bit.CS1_CS0 = 3;
Sdfm1Regs.SDCPARM4.bit.CEN = 1;
Sdfm1Regs.SDCPARM4.bit.IEH=1;
Sdfm1Regs.SDCPARM4.bit.IEL = 1;
Sdfm1Regs.SDMFILEN.bit.MFE = 1;
Sdfm1Regs.SDCTL.bit.MIE = 1;
EPwmXbarRegs.TRIP4MUX16TO31CFG.bit.MUX18 = 1;
EPwmXbarRegs.TRIP4MUX16TO31CFG.bit.MUX22 = 1;
EPwmXbarRegs.TRIP4MUXENABLE.bit.MUX18 = 1;
EPwmXbarRegs.TRIP4MUXENABLE.bit.MUX22 = 1;
Sdfm1Regs.SDCMPH2.bit.HLT = 24000;
Sdfm1Regs.SDCMPL2.bit.LLT = 10000;
Sdfm1Regs.SDCMPH4.bit.HLT = 24000;
Sdfm1Regs.SDCMPL4.bit.LLT = 10000;
EDIS;
EALLOW;
Sdfm1Regs.SDIFLGCLR.bit.MIF = 1;
EDIS;