Other Parts Discussed in Thread: TAD5212, , TAD5212-Q1
Trying to evaluate TAD5212 with TAD5212EVM-K I do NOT get DAC out (via USB from PC) PLUS PDM MICs (via USB to PC) working.
I can configure for clear DAC out OR PDM in. But the configuration differs, mainly on setting the
I2S format (register 0x1A):
For DAC out I need 1A=70 - works fine.
For PDM MIC in I need 1A=60 - works fine.
But combining both, DAC out and PDM MIC in - FAILS:
- with reg. 1A=60 - the DAC out channel 2 (right) is "wrong" (noise, distorted, quieter) = PDM in is ok
- with reg. 1A=70 - DAC out is correct, but now PDM in is full of noise, distortion (it works a bit to hear)
Strange is also the behavior on registers 0x20, 0x21 (PDM slots) and 0x52, 0x57 (PDM MIC volume):
- it works fine if 24bit configured (reg. 1A=60)
- but with 32bit (reg. 1A=70) the register 1F must be different (reg 1F=30 vs. 1F=21),
based on datasheet and comparing with DAC slot settings, actually 1F=21 makes sense, not 30)
- and the volume setting for PDM channel 1, 2 behaves strange (reg. 57 controls both channels, reg. 52 does
not matter what I set, I can mute reg. 52 - still a signal, I can set via reg. 57 the volume for both channels)
So, combining DAC out PLUS PDM in - fails.
At the end my I2C config file.
Here two waveform captures for I2S signals.
Strange is:
- configured as I2S but it looks still like TDM (FS is just a pulse, not stable during entire left channel, but OK, it seems to work)
BTW: this I2S signal waveform is generated by the XMOS AC-MB (nothing to blame on TAD5212,
running as a slave)
- even it seems to be handled properly by the XMOS AC-MB - it is still a 8 slot I2S signal
(see BCLK as 12.288 MHz, FS as 48 KHz, as 8x32bit slots still)

Figure 1: I2S waveform (generated by XMOS AC-MB): 8 slot I2S with FS as a pulse (like TDM, but working as I2S setting and only if I2S is selected, XMOS does not seem to handle it as TDM)

Figure 2: PDM in signal (channel 2, red): it is a 32bit I2S data frame!
My assumption:
The I2S timing generated is wrong (for PDM in, DOUT to USB). Or DOUT jitters a lot, does not come at the right time, is sometimes shifted by one clock edge (interleaving right and left channel values).
The USB drivers on PC uses 24bit, 48KHz (set as 2 channels for USB/DAC out, 8 channels for USB/PDM in).
The I2S to DAC is correctly a 32bit frame with 24 valid bits (OK, the LSBs are zero in 32bit data frame).
But the PDM in is also a 32bit - but now with all 32bits valid and used!
If this DOUT signal comes just a bit too late, with jitter, the LSB can go as MSB for the other channel.
This is what seems to happen (the PDM channel DOUT is not correct for the USB stream to PC).
This creates heavy noise, distortions.
If PDM MIC is set to 24bit - it is clear: obvious: now the lowests bits are also zero and even they would slip into next channel as MSBs - still OK (not setting MSB for other channel).
Configuring 24bit for DAC out (which fails) might be reasonable, e.g. now the frame is just 24bit but
the XMOS I2S to USB wants to see 32bit slots. (actually not clear how to set 24bits valid data for a 32bit frame)
So, it fails mainly by:
- configure 32bit slots (reg. 1A = 70)
- and get the PDM MIC DOUT signal out (via USB to PC) properly
(PDM MIC wants to use 24bit!)
Here my I2C configuration and watch for the comments on registers 0x1A, 0x1E, 0x1F (and 0x52, 0x57).
The volume setting for PDM channels (reg. 0x52, 0x57) behaves strange when on 32bit mode (reg. 1A=70).
w a0 00 00 #page 0
w a0 01 01
w a0 00 00 #page 0
w a0 02 09
w a0 0a 41 #PDMCLK = GPIO1
w a0 0d 02 #GPI1 = input or other function
w a0 10 51 #DOUT ss ASI DOUT
w a0 13 cc #PDM DATA config
#w a0 19 00 #default
w a0 1a 70 #0x60 for MIC USB in, 0x70 for USB out !!!!!
w a0 1e 20 #PDM MIC slot - STRANGE!
w a0 1f 21 #PDM MIC slot - STRANGE! - why 0x30? not 0x21, 0x30 works on 1a=60??
#if reg 1a-70 -> set 1f=21 !!!!!
w a0 20 00
w a0 21 00
w a0 28 20 #DAC out slot - default
w a0 29 21 #DAC out slot - default - noise with reg. 1a = 60 !!!!!
#left channel ok, right channel works only with reg 1a = 70
w a0 35 00
w a0 52 f0 #PDM MIC volume - default A1 - STRANGE - does not matter as long reg 0x57
w a0 57 f0 #PDM MIC volume - default A1 - STRANGE - mutes both! different volume!
#creates heavy noise and just 57=01... is same volume (if reg 1a=70)!
w a0 64 30
w a0 65 61
w a0 6b 30
w a0 6c 61
w a0 73 08
w a0 76 cc
w a0 00 03
w a0 38 09
w a0 39 28
w a0 3a 26
w a0 3b 20
w a0 3c 00
w a0 3d 00
w a0 3e 09
w a0 48 01
w a0 49 01
w a0 00 0a
w a0 79 fd
w a0 7a db
w a0 7b 01
w a0 7c 80
w a0 7d 02
w a0 7e 24
w a0 7f ff
w a0 00 0b
w a0 08 7f
w a0 09 fb
w a0 0a b6
w a0 0b 01
w a0 00 11
w a0 4a 00
w a0 00 19
w a0 6f 0f
w a0 00 1a
w a0 1e 00
w a0 3a 00
w a0 40 00
w a0 41 0a
w a0 42 5c
w a0 43 b6
w a0 44 e0
w a0 45 00
w a0 46 00
w a0 47 00
w a0 00 1b
w a0 66 00
w a0 67 08
w a0 6a 00
w a0 6e 80
w a0 7a 00
w a0 7b 05
w a0 00 1c
w a0 24 0c
w a0 25 cc
w a0 26 cc
w a0 27 cc
w a0 28 7f
w a0 29 ff
w a0 2a ff
w a0 2b ff
w a0 34 08
w a0 43 01
w a0 52 03
w a0 53 c0
w a0 00 00
w a0 78 C0 #enable PDM and DAC channels









