Hello,
I'm able to get my TLV320AIC3105 running perfectly with the Teensy Audio Library in I2S mode.
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; }
In TDM mode the offset is "1". So the DAC responds perfectly for each slot with 16 Bit Mode: device 1 shift 1 | device 2 shift 33 | device 3 shift 65 | device 4 shift 97.
But the ADC doesn't seem to be following the same offset?
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; }
When running in I2S mode, I get audio crisp and clear coming in from the ADC. But when I switch to TDM mode it is scratchy and loud. I can hear the gist of what's being played through it but it's clearly not on the right slot... But it seems like the ADC and DAC slots are on the same register (Page 0/Register 10)?
Is there something I should look at to try and get the ADC working in TDM mode?
Jay