以下是我的建议:
volatile
unsigned int delay = 0xFFF;
/* Select Page 0 */
CodecRegWrite(AIC31_P0_REG0, 0,sizeof(CodecWrite));
/* Reset the codec */
CodecRegWrite(AIC31_P0_REG1, AIC31_RESET,sizeof(CodecWrite));
while(delay--);
CodecRegWrite(AIC31_P0_REG9, (0u << 6u | 2u <<
4u),sizeof(CodecWrite));
CodecRegWrite(AIC31_P0_REG10, 0,sizeof(CodecWrite));
CodecRegWrite( AIC31_P0_REG8, 0x00,sizeof(CodecWrite));
CodecRegWrite(AIC31_P0_REG7, 0x0A,sizeof(CodecWrite));
//set ADC
CodecRegWrite(AIC31_P0_REG15, 0x00,sizeof(CodecWrite));
CodecRegWrite(AIC31_P0_REG16, 0x00,sizeof(CodecWrite));
CodecRegWrite(AIC31_P0_REG17, 0x0F,sizeof(CodecWrite));
CodecRegWrite(AIC31_P0_REG18, 0xF0,sizeof(CodecWrite));
CodecRegWrite(AIC31_P0_REG25, 0x40,sizeof(CodecWrite));
CodecRegWrite(AIC31_P0_REG19, 0x04,sizeof(CodecWrite));
CodecRegWrite(AIC31_P0_REG22, 0x04,sizeof(CodecWrite));
//set DAC
CodecRegWrite(AIC31_P0_REG37, 0xE0,sizeof(CodecWrite));
CodecRegWrite(AIC31_P0_REG41, 0x02,sizeof(CodecWrite));
CodecRegWrite(AIC31_P0_REG42, 0x6C,sizeof(CodecWrite));
CodecRegWrite(AIC31_P0_REG47, 0x80,sizeof(CodecWrite));
CodecRegWrite(AIC31_P0_REG46, 0x80,sizeof(CodecWrite));
CodecRegWrite(AIC31_P0_REG51, 0x01,sizeof(CodecWrite));
CodecRegWrite(AIC31_P0_REG64, 0x80,sizeof(CodecWrite));
CodecRegWrite(AIC31_P0_REG63, 0x80,sizeof(CodecWrite));
CodecRegWrite(AIC31_P0_REG65, 0x01,sizeof(CodecWrite));
//The
delay below should match the ramp up time set in register 42. this is to allow
the output to power up.Alternately wait until Reg 94 D1 = '1'.
CyDelay(500);
CodecRegWrite(AIC31_P0_REG51, 0x09,sizeof(CodecWrite));
CodecRegWrite(AIC31_P0_REG65, 0x09,sizeof(CodecWrite));
//
the delay below is a function of the soft stepping. if set to 1step per sample
this is 508/fs . if set to 1 step every 2 samples then 1016/fs.
CyDelay(500)
CodecRegWrite(AIC31_P0_REG43, 0x00,sizeof(CodecWrite));
CodecRegWrite(AIC31_P0_REG44, 0x00,sizeof(CodecWrite));
//
the delay below is a function of the soft stepping. if set to 1step per sample
this is 508/fs . if set to 1 step every 2 samples then 1016/fs.
CyDelay(500);
}
如果你能利用HPOUT上的弱偏压,这将消除任何剩余的POP音。所以在设备首次初始化时启用弱偏压。当然,在启用时会有轻微的电流消耗。
更多回帖