硬汉嵌入式论坛

 找回密码
 立即注册
查看: 1949|回复: 2
收起左侧

请教下谁搞过 tlv320aic3110 这个系列的芯片捣鼓了2天 声音异常 ?

[复制链接]

692

主题

3576

回帖

5677

积分

论坛元老

积分
5677
发表于 2018-7-31 21:24:38 | 显示全部楼层 |阅读模式
请教下谁搞过 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;
        
}

回复

使用道具 举报

1万

主题

7万

回帖

11万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
117546
QQ
发表于 2018-8-1 01:08:55 | 显示全部楼层
这个还真不太清楚,帮你找到TI的此芯片评估板了,你参考下:http://www.ti.com.cn/tool/cn/tlv320aic3110evm-u
回复

使用道具 举报

692

主题

3576

回帖

5677

积分

论坛元老

积分
5677
 楼主| 发表于 2018-8-1 09:56:37 | 显示全部楼层
eric2013 发表于 2018-8-1 01:08
这个还真不太清楚,帮你找到TI的此芯片评估板了,你参考下:http://www.ti.com.cn/tool/cn/tlv320aic3110ev ...

多谢多谢了,我再捣鼓捣鼓看看
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|Archiver|手机版|硬汉嵌入式论坛

GMT+8, 2025-8-14 03:34 , Processed in 0.036611 second(s), 24 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表