你好
我们正用tvl320aic32于我们的设备内完成通话的功能,用stm32f103的单片机控制,现在已经可以用i2c正确的写入与读取aic32的寄存器值,但是在使用i2s通讯上出现了问题,单片机i2s接口发送的数据aic32接收不到,我想知道是否改先进行哪些配置? 如何才能听到lineout播出的声音呢?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
你好:
你的单片机发出的数据是标准的I2S数据吗? 请参考以下配置。
Input:
DAC
- left data to LDAC and right data to RDAC
- volume control = 0dB
- Connected to outputs via mixer mode
Line Outputs (differential signals)
- Left and Right Line outputs
- Mono Line outputs (summed Left and Right channels)
- LDAC to Left Line Output and Mono Line Output
- RDAC to Right Line output and Mono Line Output
- Mixer gain = 0dB
- Line Output amplifier gain = 0dB}
Commands=
{w 30 07 8A
w 30 25 C0
w 30 29 02
w 30 2B 00
w 30 52 80
w 30 5C 80
w 30 4B 80
w 30 4E 80
w 30 56 09
w 30 5D 09
w 30 4F 09
}
还有就是Codec你提供的MCLK是多少?
你好:
提供MCLK 给Codec只是其中一个条件,你先配置Codec让它先能采样吧。然后配置Codec为主模式(I2S时钟从AIC33输出)。
如果你的MCLK是12M,那么需要用到内部的PLL来配置时钟到音频的采样率。
第一步就是Codec能产生I2S所需要的时钟。
0, // 2 Codec Sample Rate Select <- [ADC=FS][DAC=FS]
0x91, // 3 PLL A <- [PLL=ON][P=1][Q=2]
0x20, // 4 PLL B <- [J=8]
0xf0, // 5 PLL C <- [D=1920]
0x00, // 6 PLL D <- [D=1920]
0x0a, // 7 Codec Datapath Setup <- [FS=48 kHz][LeftDAC=LEFT][RightDAC=RIGHT]
0xc0, // 8 Audio Serial Data A <- [BCLK=Master][WCLK=Master][3DEffects=OFF][DigitalMIC=OFF]
0, // 9 Audio Serial Data B <- [Mode=I2S][Length=16-bit][TransferMode=Continous]
0, // 10 Audio Serial Data C <- [DataOffset=0]
0x01, // 11 Audio Codec Overflow Flag <- [pll R=1]
0, // 12 Audio Codec Digital Filter <- [OFF]
帮我看看这是我写入的值,有什么不对或者不够的地方么,还有第101,102两个寄存器的值需要设定么? 我一旦把单片机设置成slave模式他就不在提供MCK了,这时aic32能工作么?
你好:
你的MCLK跟I2S有联系吗?一共很MCLK,BCLK, LRLK。你没有弄错吧?AIC工作一定要MCLK。
你上面的配置只是配置了I2S的数据结构和时钟,还有模拟的输出和输入路径选择和ADC,DAC的电源。
你好:
无论AIC32工作在什么模式,都需要MCLK。使用MIC接收数据的时候AIC可以工作在Slave模式,前提是你的MCU要发I2S时钟给AIC32。
你好:
你有原理图么?这个需要根据原理图来写的。你的MIC的bias电压启动了么?
你先参考下面的程序:
Input:
EVM microphone (MIC3L/R inputs)
- Volume control = 0dB (not muted)
- MIC3L connected to LADC
- MIC3R connected to RADC
- MICBIAS = 2.5V
Ouput:
ADC
- LADC ON
- RADC ON
- PGA gain = 0dB
- Output amplifier gain = 0dB}
DAC configured for left data to LDAC and right data to RDAC
DAC volume control = 0dB
DAC connected to outputs via mixer mode
High Power Outputs are differntial capless outputs
LDAC to HPLOUT/COM
RDAC to HPRDAC/COM
High Power output gains = 0dB.}
Commands=
{w 30 11 0F
w 30 12 F0
w 30 16 7C
w 30 13 7C
w 30 0F 00
w 30 10 00
w 30 19 80}
你好:
首先,register 19和22这两个不是只读的,你可能看错了。由于AIC32的LIN1L与MIC1L是一样的,所以不需要修改输入。你尝试把增益改大点,改成30dB在试下。
并且确认下I2S的时钟还在吗?还有就是你怎么知道没有声音呢?你是要通过MIC的数据从Speaker放出来吗?如果这样的话,你要把Din与Dout连接在一起。