器件型号:TLV320AIC3105
您好!
我能够让 TLV320AIC3105在 I2S 模式下与 teensy 音频库完美地运行。
bool AudioControlTLV320AIC3105::aic3105_initCLK (select_wire wires, device dev){ //Table 12. Page 0/Register 7: Codec Datapath Setup Register writeRegister(wires, dev, Page_00, 0x07, 0b10001010);// w 30 07 8A P0_R7 0b10001010 //Table 13. Page 0/Register 8: Audio Serial Data Interface Control Register A // D5 R/W 0 Serial Output Data Driver (DOUT) 3-State Control // 0: Do not place DOUT in high-impedance state when valid data is not being sent. // 1: Place DOUT in high-impedance state when valid data is not being sent. writeRegister(wires, dev, Page_00, 0x09, 0b00100000); // Table 14. Page 0/Register 9: Audio Serial Data Interface Control Register B writeRegister(wires, dev, Page_00, 0x09, 0b00000000); //Table 100. Page 0/Register 102: Clock Generation Control Register //writeRegister(wires, dev, Page_00, 0x66, 0b00000010);// w 30 66 A0 P0_R102 0b10100000 return true; }
在 TDM 模式中、偏移为"1"。 因此、DAC 在每个插槽具有 16位模式时都能完美响应:器件1移位1 |器件2移位33 |器件3移位65 |器件4移位97。
但 ADC 似乎没有遵循相同的失调电压?
bool AudioControlTLV320AIC3105::aic3105_enableTDM(select_wire wires, device dev) { //Table 14. Page 0/Register 9: Audio Serial Data Interface Control Register B //Set to DSP mode //Specify 32 bit word length. writeRegister(wires, dev, Page_00, 9, 0b01000111); //Table 15. Page 0/Register 10: Audio Serial Data Interface Control Register C //Set the Offset 1 bit clock - 255 bit clocks. // 16 Bit Mode: device 1 shift 1 | device 2 shift 33 | device 3 shift 65 | device 4 shift 97 writeRegister(wires, dev, Page_00, 10, 33); return true; }
在 I2S 模式下运行时、ADC 输出的音频非常清晰明了。 但是、当我切换到 TDM 模式时、声音很大、而且很尖锐。 我可以听到它所扮演的关键,但它显然不在正确的位置... 但是、ADC 和 DAC 时隙似乎在同一个寄存器(页0/寄存器10)上?
是否应该考虑某种因素以尝试使 ADC 在 TDM 模式下工作?
杰伊