Part Number:TLV320AIC3101Other Parts Discussed in Thread: TLV320AIC31
最近在海思SS528平台上调试TLV320AIC3101的驱动,硬件做了一路MIC输入、一路LINE IN 输入和一路LINE OUT,原理图如下:
调试了好久,一直没有声音输出,我的寄存器配置:
void soft_reset(unsigned int chip_num)
{
// soft reset
tlv320aic31_write(IIC_device_addr[chip_num], 1,0×80);
msleep(10);
/*CLKDIV_IN uses MCLK*/
tlv320aic31_write(IIC_device_addr[chip_num], 102, 0x32);
#if 1
/*PLL disable and select Q value*/
tlv320aic31_write(IIC_device_addr[chip_num], 3, 0x10);
#else
// PLL enable tlv320aic31_write(IIC_device_addr[chip_num], 3, 0x81);/* P=1 Q=16*/
tlv320aic31_write(IIC_device_addr[chip_num], 4, 0x20);/* J=8 */
tlv320aic31_write(IIC_device_addr[chip_num], 5, 0x00);
tlv320aic31_write(IIC_device_addr[chip_num], 6, 0x00);
#endif
// left and right DAC open
tlv320aic31_write(IIC_device_addr[chip_num], 7, 0x0a);/* 48 kHz */
// sample
tlv320aic31_write(IIC_device_addr[chip_num], 2, 0xaa);/* FS = FSref/6 */
// ctrl mode
tlv320aic31_write(IIC_device_addr[chip_num], 8, 0x00);/* slave mode */
// Audio Serial Data Interface Control
tlv320aic31_write(IIC_device_addr[chip_num], 9, 0x07);/* I2S mode,16bit */
// Data offset = 0 bit clocks tlv320aic31_write(IIC_device_addr[chip_num], 10, 0x00);
// Audio Codec Digital Filter Control Register
tlv320aic31_write(IIC_device_addr[chip_num], 12, 0x50);
tlv320aic31_write(IIC_device_addr[chip_num], 14, 0x00);
// The ADC PGA is not muted.
tlv320aic31_write(IIC_device_addr[chip_num], 15, 0x00);
tlv320aic31_write(IIC_device_addr[chip_num], 16, 0x00);
// LINE2L connected to the left ADC PGA
tlv320aic31_write(IIC_device_addr[chip_num], 17, 0x0f);
// LINE2R connected to the right ADC PGA
tlv320aic31_write(IIC_device_addr[chip_num], 18, 0xf0);
// LINE1LP is configured in single-ended mode
// LINE1L connected to the left-ADC PGA
// Left-ADC channel is powered up
tlv320aic31_write(IIC_device_addr[chip_num], 19, 0x04);
// LINE1RP is configured in single-ended mode
tlv320aic31_write(IIC_device_addr[chip_num], 21, 0xC0);
// LINE1RP is configured in single-ended mode
// LINE1R connected to the right-ADC PGA
// Right-ADC channel is powered up
tlv320aic31_write(IIC_device_addr[chip_num], 22, 0x04);
// LINE1LP is configured in single-ended mode
tlv320aic31_write(IIC_device_addr[chip_num], 24, 0xC0);
// Left DAC is powered up
// Right DAC is powered up
// HPLCOM is configured as independent single-ended output
tlv320aic31_write(IIC_device_addr[chip_num], 37, 0xe0);
// HPRCOM is configured as independent single-ended output
tlv320aic31_write(IIC_device_addr[chip_num], 38, 0x10);
// Left-DAC output selects DAC_L1 path,
// Right-DAC output selects DAC_R1 path
tlv320aic31_write(IIC_device_addr[chip_num], 41, 0x00);
// PGA_L is routed to HPLOUT
tlv320aic31_write(IIC_device_addr[chip_num], 46, 0x80);
// DAC_L1 is routed to HPLOUT
tlv320aic31_write(IIC_device_addr[chip_num], 47, 0x80);
// PGA_R is routed to HPLOUT
tlv320aic31_write(IIC_device_addr[chip_num], 49, 0x00);
// DAC_R1 is routed to HPLOUT
tlv320aic31_write(IIC_device_addr[chip_num], 50, 0x00);
// HPLOUT is not muted, HPLOUT is fully powered up
tlv320aic31_write(IIC_device_addr[chip_num], 51, 0x0f);
// PGA_L is routed to HPLCOM.
tlv320aic31_write(IIC_device_addr[chip_num], 53, 0x00);
// DAC_L1 is routed to HPLCOM
tlv320aic31_write(IIC_device_addr[chip_num], 54, 0x80);
// PGA_R is routed to HPLCOM
tlv320aic31_write(IIC_device_addr[chip_num], 56, 0x00);
// DAC_R1 is routed to HPLCOM
tlv320aic31_write(IIC_device_addr[chip_num], 57, 0x00);
// HPLCOM is not muted, HPLCOM is fully powered up
tlv320aic31_write(IIC_device_addr[chip_num], 58, 0x0f);
// PGA_L is routed to HPROUT
tlv320aic31_write(IIC_device_addr[chip_num], 60, 0x80);
// DAC_L1 is routed to HPROUT
tlv320aic31_write(IIC_device_addr[chip_num], 61, 0x80);
// PGA_R is routed to HPROUT
tlv320aic31_write(IIC_device_addr[chip_num], 63, 0x00);
// DAC_R1 is routed to HPROUT
tlv320aic31_write(IIC_device_addr[chip_num], 64, 0x00);
// HPROUT is not muted, HPROUT is fully powered up
tlv320aic31_write(IIC_device_addr[chip_num], 65, 0x0f);
// PGA_L is routed to HPRCOM
tlv320aic31_write(IIC_device_addr[chip_num], 67, 0x00);
// DAC_L1 is routed to HPRCOM
tlv320aic31_write(IIC_device_addr[chip_num], 68, 0x80);
// PGA_R is routed to HPRCOM
tlv320aic31_write(IIC_device_addr[chip_num], 70, 0x00);
// DAC_R1 is routed to HPRCOM
tlv320aic31_write(IIC_device_addr[chip_num], 71, 0x00);
// HPRCOM is not muted, HPRCOM is fully powered up
tlv320aic31_write(IIC_device_addr[chip_num], 72, 0x0f);
// The left-DAC channel is not muted.
tlv320aic31_write(IIC_device_addr[chip_num], 43, 0x80);
// The right-DAC channel is not muted
tlv320aic31_write(IIC_device_addr[chip_num], 44, 0x80);
}
不知道我的这个寄存器配置与我的硬件原理图是否匹配吗?
Kailyn Chen:
您好,register 15和16 的left ADC和right ADC gain设置的是0dB,建议增大增益再看看。
同样寄存器R43,R44 left和right DACvolume也建议将volume control 增大,不使用0dB。
R51 HPLOUT的output level也建议调大。
,
? ??:
谢谢您的解答,现在line in接入音频信号,line out有声音输出了。但是MIC输入还是没有声音,请问是哪里问题呢?line in 和 MIC in能够同时存在吗?是不是配置了line in之后MIC in就不起作用了
,
Kailyn Chen:
您好,这款codec的line in和mic in是复用引脚,您的意思是channel 1 做line in, channel 2作为mic in是吗?
,
? ??:
我的硬件电路line in和mic in是独立的接口:MIC2L/LINE2L/MICDET、MIC2R/LINE2R 引脚作为 line in,MIC1RP/LINE1RP、MIC1RM/LINE1RM 引脚作为mic in。现在line out 能听到line in的输入声音,不能听到mic in的声音,是不是需要配置哪些寄存器呢?
,
Kailyn Chen:
您好,通过内部架构可以看出,这几个输入是通过内部的mixing进行处理的。
在mix之前集成是运放,可以看如下框图,这个是左通道的,右通道类似架构,听不到mic的声音,应该是运放前的开关没有配置,开关闭合之后这几个输入才会进入mixer,然后到left ADC PGA。
,
? ??:
我向 Page 0/Register 21 写入0xc0,Page 0/Register 22 写入0xc4,但是还是听不到mic的声音,是不是我理解错了呢?
,
Kailyn Chen:
? ?? said:Page 0/Register 21
您好,这个寄存器是配置MIC1RP/LINE1RP到left ADC的路由。
? ?? said:Page 0/Register 22
这个寄存器是配置的MIC1RP/LINE1RP到right ADC的路由。
这样就矛盾了吧。
另外,上述配置的都是按照mic 差分模式输入的。
如果是差分的话MIC1RP/LINE1RP、MIC1RM/LINE1RM是mic right chanel的两个差分信号。
那么左通道的MIC1LM/LINE1LM和MIC1LP/LINE1LP 应该也要配置的。
如果单端输入的话,那么只使用MIC1RP和MIC1LP作为左右通道的单端输入。
,
? ??:
您好,能否加我QQ进一步指导一下,有偿。QQ:317397151
,
Kailyn Chen:
您好,您的问题我会再继续跟进和确认的。
另外,我们目前的支持方式是以论坛的方式和您沟通的,没有其他方式并且也是无偿的哈。
,
? ??:
我的电路上TLV320AIC31的MICBIAS引脚接地了,会对MIC的MIC1RP/LINE1RP、MIC1RM/LINE1RM引脚输入信号有影响吗?
,
Kailyn Chen:
MICBIAS是输出引脚,是headphone偏置输出电压,偏置输出电压的值可通过Page 0/Register 25 去配置,比如输出2V或者2.5V。
接GND是Page 0/Register 25 配置的micbias output power down了吗?
建议将其配置为一定的输出电压 ,比如2.5V 验证下。