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.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;
}
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 16 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;
}
Yes but my phone auto uploads to the Internet for easy retrieval. As opposed to swapping devices. But eh, maybe I'll try that next time. Thanks!You do know you can do screen captures to a USB stick on that 'scope, don't you?
x10 mode uses a capacitive divider in parallel with a resistive divider to maintain good bandwidth, x1 mode acts as an RC low pass filter limiting the bandwidth by around an order of magnitude typically. 'Scope probes are very clever.Hello MarkT,
Thanks for the advice. I didn't know. But you are right, it looks better maybe when 10x is enabled on the probe, and 10x is also enabled on the scope. I presume that's how it's done. My yellow probe is broken, so the 10x switch doesn't work. So I am showing just one signal line at a time.
Just digging into the data sheet more ... can't find the place where it says you can do 256-clock mode as a slave. Also, your 'scope trace looks like the word clock pulse is half a clock different from the datasheet - wondering if that's relevant.
You can change the polarity, and it looks as if it might be worth a try. InI'm thinking that the word clock should rise when the bitclock rises, and that's the reason for the issues. Is there a setting somewhere to change the clock timing on the i.MX RT1060 SAI?
output_tdm.cpp
there are lines to set the Bit Clock Polarity, e.g. on this line, also here. i.MX RT1060 Reference manual sections 38.5.1.6.4 and 38.5.1.15.4That's right for I2S, but not for DSP mode, which looks like this:According to the TLV320AIC3105 datasheet, WCLK must *NOT* rise together with BCLK.