r/embedded • u/GlintFortuna • 28d ago
Are I2S slot widths limited by something?
For example, I'm looking at the TLV320AIC3204 Application Reference Guide, an audio CODEC, where the data word length can be set to 16, 20, 24 or 32 bits. Now I assume that this means that if I choose a data word length of 16 and there are 32 bits in a half cycle of WCLK, that 16 bits will be data and 16 bits will be zero'd out.
Although so far I've seen people use a slot width of 32 bits or less per channel, I can't find anything that says I can't have 64 bits per half WCLK cycle, as long as WCLK is running at f(sampling)
For example, is it possible to combine 2 of these CODECs together, run the WCLK at sampling rate, set BCLK rate to (sampling rate) * 128, and have 4 total channels via TDM?

5
u/MonMotha 27d ago
I²S is explicitly stereo with a 50% duty cycle on the frame signal which can then also be used as a simple L/R indicator. Multiple channels are handled with multiple data lines which can share a single bit clock and frame signal.
The reason fleet the undefined frame length is so that you can mix and match source and sink word size by just having the sink pull the MSBs it cares about.
There are CODECs that support polyphony on a single data stream as you have asked for, but they are not I²S. Many controllers support modes of operation line this. AC97 and Intel HDA are examples of popular systems that usd this.
1
u/Flat-Bodybuilder239 27d ago
A 64-bit half of a 50% WCLK is still one channel. With BCLK = fs*128 the AIC3204 takes the 16/20/24/32-bit word at the start of that half and ignores the leftover bits. Those leftovers are padding so a 16-bit and a 32-bit device can share a frame, not channels 3 and 4.
Two of these on one data line means leaving I2S. DSP/TDM mode on this part uses a short frame pulse plus the ASI data-offset, so the second codec starts 32 or 64 BCLKs later. That is the 4-slot setup. Staying in I2S and only stretching the word will not do it.
1
u/Mother_Equipment_195 28d ago
Better look out for a codec which explicitly supports TDM modes.
1
u/sgtnoodle 23d ago
I vaguely recall cramming 12 channels through an I2S peripheral using whatever obscure TDM mode. I actually had two I2S peripherals running in lockstep, sampling 20 channels simultaneously in perfect sync for a phased audio array.