|
本帖最后由 hpdell 于 2018-7-31 21:25 编辑
请教下谁搞过tlv320aic3110 这个系列的芯片捣鼓了2天 声音异常 ???
使用 stm32 作为主控,i2c 接口
现在 按照 ti 官方的 资料的 播放测试历程,目前声音是出来了,但是声音不正常,有嘶哑或者是破音的感觉,
所以想请教下,是哪里没有设置对啊 ???
望大佬们赐教啊 !!!
/*
******************************************************************************************
* 函数名称:AIC31XX_SetExample_44K
* 函数功能:设置44.1K, MCLK=11.2896MHz,16bit 示例,这个是官方的测试播放测试历程
* 参数 无
* 返回值:无
******************************************************************************************
*/
void AIC31XX_SetExample_44K(void)
{
volatile uint8_t err;
LM4871_SWITCH_OFF;
err = AIC31XX_Write(0, 0); //Select Page 0
err = AIC31XX_Write(1, 1 ); //Software reset
err = AIC31XX_Write(4, 3 ); //PLL_clkin = MCLK, codec_clkin = PLL_CLK
err = AIC31XX_Write(5, 0x91); //PLL Power up, P = 1, R = 1
err = AIC31XX_Write(6, 0x08); //J = 8
err = AIC31XX_Write(7, 0x00); //D = 0000, D(13:8) = 0
err = AIC31XX_Write(8, 0x00); //D = 0000, D(7:0) = 0
err = AIC31XX_Write(0x1B, 0x00); /* Mode is I2S, Wordlength is 16
bit7-6 00: Codec interface = I2S
01: Codec Interface = DSP
10: Codec interface = RJF
11: Codec interface = LJF
bit5-4 00: Codec interface word length = 16 bits
01: Codec interface word length = 20 bits
10: Codec interface word length = 24 bits
11: Codec interface word length = 32 bits
bit3 0: BCLK is input
1: BCLK is output
bit2 0: WCLK is input
1: WCLK is output
bit1 Reserved
bit0 Driving DOUT to High-Impedance for the Extra BCLK Cycle When Data Is Not Being Transferred
0: Disabled
1: Enabled
*/
err = AIC31XX_Write(0x0B, 0x84); //NDAC is powered up and set to 4
err = AIC31XX_Write(0x0C, 0x84); //MDAC is powered up and set to 4
err = AIC31XX_Write(0x0D, 0x00); //DOSR = 128, DOSR(9:8) = 0, DOSR(7:0) = 128
err = AIC31XX_Write(0x0E, 0x80); //DOSR = 128, DOSR(9:8) = 0, DOSR(7:0) = 128
err = AIC31XX_Write(0x74, 0x00); //DAC => volume control thru pin disable
err = AIC31XX_Write(0x44, 0x00); //DAC => DRC disable
err = AIC31XX_Write(0x41, 0xD4); //DAC => -22 db gain left
err = AIC31XX_Write(0x42, 0xD4); //DAC => -22 db gain right
// ============================================================================
err = AIC31XX_Write(0, 1); //Select Page 1
err = AIC31XX_Write(0x21, 0x4E); //De-pop, Power on = 800 ms, Step time = 4 ms
err = AIC31XX_Write(0x1F, 0xC2); //HPL and HPR powered up
err = AIC31XX_Write(0x23, 0x44); //LDAC routed to HPL, RDAC routed to HPR
err = AIC31XX_Write(0x28, 0x06); //HPL unmute and gain = 0db 耳机
err = AIC31XX_Write(0x29, 0x06); //HPR unmute and gain = 0db 耳机
err = AIC31XX_Write(0x2A, 0x1C); //Unmute Class-D Left SPL 喇叭 24 dB
err = AIC31XX_Write(0x2B, 0x1C); //Unmute Class-D Right SPR 喇叭 24 dB
err = AIC31XX_Write(0x20, 0xC6); //Power-up Class-D drivers
err = AIC31XX_Write(0x24, 0x92); //Enable HPL output analog volume, set = -9 dB
err = AIC31XX_Write(0x25, 0x92); //Enable HPR output analog volume, set = -9 dB
err = AIC31XX_Write(0x26, 0x92); //Enable HPL output analog volume, set = -9 dB
err = AIC31XX_Write(0x27, 0x92); //Enable HPR output analog volume, set = -9 dB
// ============================================================================
err = AIC31XX_Write(0, 0); //Select Page 0
err = AIC31XX_Write(0x3C, 0x0B); //Select DAC DSP Processing Block PRB_P11
err = AIC31XX_Write(0x00, 0x08);
err = AIC31XX_Write(0x01, 0x04);
err = AIC31XX_Write(0x00, 0x00);
err = AIC31XX_Write(0x3F, 0xD6); //SPowerup DAC left and right channels (soft step disable)
err = AIC31XX_Write(0x40, 0x00); //Unmute DAC left and right channels
LM4871_SWITCH_ON;
} |
阿莫论坛20周年了!感谢大家的支持与爱护!!
曾经有一段真挚的爱情摆在我的面前,我没有珍惜,现在想起来,还好我没有珍惜……
|