This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TLV320AIC3101: Initial configuration for audio codec via I2C

Part Number: TLV320AIC3101

Hello,

We are using TLV320AIC3101 chip that is connected to hub in our project. The hub is able to communicate with different audio codec chips via I2C and I2S interfaces. We have checked I2S signals  with oscilloscope and they are fine. Initial sequence for codec configuration also looks fine but we are not sure about that because the TLV320AIC3101 does not generate valid audio output for headphones.

here is the I2C initial sequence caught with logic analyser:

The codec responds with ACK bit for every message but is this right way of configuring it? The datasheet does not provide enough information about the initial sequence for codec configuration so we are not sure about the messages we need to generate. For now we are trying to modify registers 8, 9,14, 37, 41, 43, 44, but there is no output on audio side. Can you please check if there is something missing, or how should initial sequence for this codec look. Please keep in mind that we are using hub, not a controller so we are able only to put I2C commands in its registers, so it generate I2C initial sequence after the reset...

Thank you in advance!

Jovana Matkovic

  • Hi,

    I have attached here the block diagram with the register that might help you to configure this device audio path.

      

    If the codec is in target/slave mode, then check your ASI clocks make sure they are correct.

    If you have the EVM, there are some preset configurations that you can load and test. 

    Here is an example for AC-Coupled headphone path and its register setting.

    Regartds.

  • I have tried with some of these configurations from the software, but in capless configuration (capacitors shorted) always got a DC output (about 0.6V) on HPLOUT and HPROUT... We do not have evaluation board, we need the codec to work with the USB hub... These is initial sequence I generated with the hub and sent to the codec today...

    Here I used commands from the software you mentioned:

    So maybe the problem is in the nature of those I2C sequence, I am not sure what form of the I2C signals the codec expects to receive after the reset..

  • The script label has a typo, it should be AC-Coupled instead of capless.

    You can see register 0x0E is 0x80 which is AC-Coupled, you can change that to 0x00.

    How is your ASI clocks look like? Can you capture that and what is your full configuration? Is this master/slave mode etc.

    I need to see your full settings and are you running a continuous 1KHz sine tone in this debug?

    There are status registers like register 94-95 that you can check if the modules are powered etc.

    Regards.

  • The data stream from PC is converted to I2S by the hub. The codec is in slave mode and should convert these signals to audio. Here is the capture obtained on I2S lines when I play the music on the PC.

    In this case I get 0.6V DC signals on HPLOUT and HPROUT lines, so I think the configuration of the codec is wrong.

    Every time when the hub is powered on it sends initialization sequence to the codec via I2C. This is the configuration I firstly tried to achieve before trying with the preset configurations from AIC310x EVM GUI software (captured in the first comment):

    Regards.

  • Hi Jovana,

    Thanks for the information. Peter is out of office for holidays. He will be back on Jan 2nd to answer your questions. Thanks for your patience,

    Jeff McPherson

  • The ASI bus looks correct except it's for 16-bit bit depth, register 9 is set to 32-bit depth. You can set it to 0x00 in this register.

    Nonetheless I need to see the full configuration of the codec, can you run i2cdump or provide the full register setting?

    Regards.

  • Hi,

    Here is the full register setting obtained by the logic analyzer.

    page 0

    register data
    0 0x00
    1 0x00
    2 0x10
    3 0x04
    4 0x00
    5 0x00
    6 0x6A
    7 0x66
    8 0x00
    9 0x28
    10 0x00
    11 0x2B
    12 0x00
    13 0x08
    14 0x80
    15 0x80
    16 0xFF
    17 0xFF
    18 0x78
    19 0x78
    20 0x78
    21 0x78
    22 0x78
    23 0x78
    24 0x06
    25 0x00
    26 0xFE
    27 0x00
    28 0x00
    29 0xFE
    30 0x00
    31 0x00
    32 0x11
    33 0x00
    34 0x00
    35 0x00
    36 0xE0
    37 0x10
    38 0x00
    39 0x44
    40 0xA0
    41 0x3C
    42 0x80
    43 0x41
    44 0x0D
    45 0x00
    46 0x00
    47 0x00
    48 0x00
    49 0x00
    50 0x04
    51 0x00
    52 0x00
    53 0x00
    54 0x00
    55 0x00
    56 0x00
    57 0x04
    58 0x00
    59 0x00
    60 0x00
    61 0x00
    62 0x00
    63 0x00
    64 0x04
    65 0x00
    66 0x00
    67 0x00
    68 0x00
    69 0x00
    70 0x00
    71 0x04
    72 0x00
    73 0x00
    74 0x00
    75 0x00
    76 0x00
    77 0x00
    78 0x00
    79 0x00
    80 0x00
    81 0x00
    82 0x00
    83 0x00
    84 0x00
    85 0x00
    86 0x00
    87 0x00
    88 0x00
    89 0x00
    90 0x00
    91 0x00
    92 0x00
    93 0xC0
    94 0x00
    95 0x00
    96 0x00
    97 0x00
    98 0x00
    99 0x00
    100 0x00
    101 0x02
    102 0x00
    103 0x00
    104 0x00
    105 0x00
    106 0x00
    107 0x00
    108 0x00
    109 0x00
    110 0x00
    111 0x00
    112 0x00
    113 0x00
    114 0x00
    115 0x00
    116 0x00
    117 0x00
    118 0x00
    119 0x00
    120 0x00
    121 0x00
    122 0x00
    123 0x00
    124 0x00
    125 0x00
    126 0x00
    127 0x00

    page 1

    register data
    0 0xE3
    1 0x96
    2 0x66
    3 0x67
    4 0x5D
    5 0x6B
    6 0xE3
    7 0x96
    8 0x66
    9 0x67
    10 0x5D
    11 0x7D
    12 0x83
    13 0x84
    14 0xEE
    15 0x7D
    16 0x83
    17 0x84
    18 0xEE
    19 0x39
    20 0x55
    21 0xF3
    22 0x2D
    23 0x53
    24 0x7E
    25 0x6B
    26 0xE3
    27 0x96
    28 0x66
    29 0x67
    30 0x5D
    31 0x6B
    32 0xE3
    33 0x96
    34 0x66
    35 0xA0
    36 0x10
    37 0x7D
    38 0x83
    39 0x84
    40 0xEE
    41 0x7D
    42 0x83
    43 0x84
    44 0xEE
    45 0x39
    46 0x55
    47 0xF3
    48 0x2D
    49 0x53
    50 0x7E
    51 0x7F
    52 0xFF
    53 0x00
    54 0x00
    55 0x00
    56 0x00
    57 0x00
    58 0x00
    59 0x00
    60 0x00
    61 0x00
    62 0x00
    63 0x7F
    64 0xEA
    65 0x80
    66 0x16
    67 0x7F
    68 0xD5
    69 0x7F
    70 0xEA
    71 0x80
    72 0x16
    73 0x7F
    74 0xD5
    75 0x00
    76 0x00
    77 0x00
    78 0x00
    79 0x00
    80 0x00
    81 0x00
    82 0x00
    83 0x00
    84 0x00
    85 0x00
    86 0x00
    87 0x00
    88 0x00
    89 0x00
    90 0x00
    91 0x00
    92 0x00
    93 0x00
    94 0x00
    95 0x00
    96 0x00
    97 0x00
    98 0x00
    99 0x00
    100 0x00
    101 0x00
    102 0x00
    103 0x00
    104 0x00
    105 0x00
    106 0x00
    107 0x00
    108 0x00
    109 0x00
    110 0x00
    111 0x00
    112 0x00
    113 0x00
    114 0x00
    115 0x00
    116 0x00
    117 0x00
    118 0x00
    119 0x00
    120 0x00
    121 0x00
    122 0x00
    123 0x00
    124 0x00
    125 0x00
    126 0x00
    127 0x00

    Regards!

  • This register does not look like a correct register as shown in the attached file.

    • Some of the registers are not matching to what you have sent above.
    • Bit depth is set to 24 bits, but your scope captured above is for 16-bit I2S mode.
    • Both left and Right DAC are powered down.
    • Both HP are not powered
    • etc.

    page 0
    
    reg	data	Comment
    0	0x00
    1	0x00
    2	0x10	ADC: fsref/1.5, DAC: fsref/1
    3	0x04	PLL disabled, Q=16, P=4
    4	0x00	No J value, this should not be set to 0x00. Keep default 0x04 for J=1
    5	0x00
    6	0x6A	D=26? Last 2 bits should be 0
    7	0x66	fsref=48KHz, Left DAC muted and Right DAC mono mix of left and right input
    8	0x00	Slave/target mode
    9	0x28	I2S mode, 24-bits, 256 bit clocks/frame(can leave it default '0')
    10	0x00
    11	0x2B	R=11
    12	0x00
    13	0x08
    14	0x80	AC-Coupled
    15	0x80	Left ADC muted
    16	0xFF	Right ADC muted
    17	0xFF
    18	0x78
    19	0x78
    20	0x78
    21	0x78
    22	0x78
    23	0x78
    24	0x06
    25	0x00
    26	0xFE
    27	0x00
    28	0x00
    29	0xFE
    30	0x00
    31	0x00
    32	0x11
    33	0x00
    34	0x00
    35	0x00
    36	0xE0
    37	0x10	Left and Right DAC are not powered up
    38	0x00
    39	0x44
    40	0xA0
    41	0x3C	Left-DAC is DAC_L1 path, but Right-DAC path is not set.
    42	0x80
    43	0x41	Left-DAC not muted
    44	0x0D	Right-DAC not muted different gain from Left-DAC
    45	0x00
    46	0x00
    47	0x00
    48	0x00
    49	0x00
    50	0x04
    51	0x00	HPLOUT is muted and not powered up
    52	0x00
    53	0x00
    54	0x00
    55	0x00
    56	0x00
    57	0x04
    58	0x00
    59	0x00
    60	0x00
    61	0x00
    62	0x00
    63	0x00
    64	0x04
    65	0x00	HPROUT is muted and not powered up
    66	0x00
    67	0x00
    68	0x00
    69	0x00
    70	0x00
    71	0x04
    72	0x00
    73	0x00
    74	0x00
    75	0x00
    76	0x00
    77	0x00
    78	0x00
    79	0x00
    80	0x00
    81	0x00
    82	0x00
    83	0x00
    84	0x00
    85	0x00
    86	0x00
    87	0x00
    88	0x00
    89	0x00
    90	0x00
    91	0x00
    92	0x00
    93	0xC0
    94	0x00
    95	0x00
    96	0x00
    97	0x00
    98	0x00
    99	0x00
    100	0x00
    101	0x02
    102	0x00
    103	0x00
    104	0x00
    105	0x00
    106	0x00
    107	0x00
    108	0x00
    109	0x00
    110	0x00
    111	0x00
    112	0x00
    113	0x00
    114	0x00
    115	0x00
    116	0x00
    117	0x00
    118	0x00
    119	0x00
    120	0x00
    121	0x00
    122	0x00
    123	0x00
    124	0x00
    125	0x00
    126	0x00
    127	0x00
    
    page 1
    
    register	data
    0	0xE3
    1	0x96
    2	0x66
    3	0x67
    4	0x5D
    5	0x6B
    6	0xE3
    7	0x96
    8	0x66
    9	0x67
    10	0x5D
    11	0x7D
    12	0x83
    13	0x84
    14	0xEE
    15	0x7D
    16	0x83
    17	0x84
    18	0xEE
    19	0x39
    20	0x55
    21	0xF3
    22	0x2D
    23	0x53
    24	0x7E
    25	0x6B
    26	0xE3
    27	0x96
    28	0x66
    29	0x67
    30	0x5D
    31	0x6B
    32	0xE3
    33	0x96
    34	0x66
    35	0xA0
    36	0x10
    37	0x7D
    38	0x83
    39	0x84
    40	0xEE
    41	0x7D
    42	0x83
    43	0x84
    44	0xEE
    45	0x39
    46	0x55
    47	0xF3
    48	0x2D
    49	0x53
    50	0x7E
    51	0x7F
    52	0xFF
    53	0x00
    54	0x00
    55	0x00
    56	0x00
    57	0x00
    58	0x00
    59	0x00
    60	0x00
    61	0x00
    62	0x00
    63	0x7F
    64	0xEA
    65	0x80
    66	0x16
    67	0x7F
    68	0xD5
    69	0x7F
    70	0xEA
    71	0x80
    72	0x16
    73	0x7F
    74	0xD5
    75	0x00
    76	0x00
    77	0x00
    78	0x00
    79	0x00
    80	0x00
    81	0x00
    82	0x00
    83	0x00
    84	0x00
    85	0x00
    86	0x00
    87	0x00
    88	0x00
    89	0x00
    90	0x00
    91	0x00
    92	0x00
    93	0x00
    94	0x00
    95	0x00
    96	0x00
    97	0x00
    98	0x00
    99	0x00
    100	0x00
    101	0x00
    102	0x00
    103	0x00
    104	0x00
    105	0x00
    106	0x00
    107	0x00
    108	0x00
    109	0x00
    110	0x00
    111	0x00
    112	0x00
    113	0x00
    114	0x00
    115	0x00
    116	0x00
    117	0x00
    118	0x00
    119	0x00
    120	0x00
    121	0x00
    122	0x00
    123	0x00
    124	0x00
    125	0x00
    126	0x00
    127	0x00

  • I had a struggle with I2C signals, so the obtained readings were bad (the format of I2C read signal was wrong so the device was not in auto-increment mode). Now I managed to get valid readings, but there is still no audio output on HPLOUT and HPROUT (now I get 1.3V DC signal on both pins even if the headset is plugged in). Here is the new I2C dump file:

    I2C page 0
    0)	0
    1)	0
    2)	0
    3)	84
    4)	4
    5)	0
    6)	0
    7)	6A
    8)	0
    9)	0
    10)	33
    11)	30
    12)	0
    13)	0
    14)	0
    15)	0
    16)	0
    17)	0
    18)	0
    19)	0
    20)	0
    21)	0
    22)	0
    23)	0
    24)	40
    25)	6
    26)	0
    27)	0
    28)	0
    29)	0
    30)	0
    31)	0
    32)	0
    33)	0
    34)	0
    35)	0
    36)	11
    37)	E0
    38)	10
    39)	0
    40)	0
    41)	A0
    42)	0
    43)	0
    44)	0
    45)	0
    46)	0
    47)	0
    48)	0
    49)	0
    50)	0
    51)	F
    52)	0
    53)	0
    54)	0
    55)	0
    56)	0
    57)	0
    58)	0
    59)	0
    60)	0
    61)	0
    62)	0
    63)	0
    64)	0
    65)	F
    66)	0
    67)	0
    68)	0
    69)	0
    70)	0
    71)	0
    72)	0
    73)	0
    74)	0
    75)	0
    76)	0
    77)	0
    78)	0
    79)	0
    80)	0
    81)	0
    82)	0
    83)	0
    84)	0
    85)	0
    86)	0
    87)	0
    88)	0
    89)	0
    90)	0
    91)	0
    92)	0
    93)	0
    94)	C6
    95)	0
    96)	0
    97)	0
    98)	0
    99)	0
    100)	0
    101)	0
    102)	0
    103)	0
    104)	0
    105)	0
    106)	24
    107)	10
    108)	0
    109)	0
    110)	0
    111)	0
    112)	0
    113)	0
    114)	0
    115)	0
    116)	0
    117)	0
    118)	0
    119)	0
    120)	0
    121)	0
    122)	0
    123)	0
    124)	0
    125)	0
    126)	0
    127)	0
    
    I2C page 1
    0)	1
    1)	6B
    2)	E3
    3)	96
    4)	66
    5)	67
    6)	5D
    7)	6B
    8)	E3
    9)	96
    10)	66
    11)	67
    12)	5D
    13)	7D
    14)	83
    15)	84
    16)	EE
    17)	7D
    18)	83
    19)	84
    20)	EE
    21)	39
    22)	55
    23)	F3
    24)	2D
    25)	53
    26)	7E
    27)	6B
    28)	E3
    29)	96
    30)	66
    31)	67
    32)	5D
    33)	6B
    34)	E3
    35)	96
    36)	66
    37)	67
    38)	5D
    39)	7D
    40)	83
    41)	84
    42)	EE
    43)	7D
    44)	83
    45)	84
    46)	EE
    47)	39
    48)	55
    49)	F3
    50)	2D
    51)	53
    52)	7E
    53)	7F
    54)	FF
    55)	0
    56)	0
    57)	0
    58)	0
    59)	0
    60)	0
    61)	0
    62)	0
    63)	0
    64)	0
    65)	7F
    66)	EA
    67)	80
    68)	16
    69)	7F
    70)	D5
    71)	7F
    72)	EA
    73)	80
    74)	16
    75)	7F
    76)	D5
    77)	0
    78)	0
    79)	0
    80)	0
    81)	0
    82)	0
    83)	0
    84)	0
    85)	0
    86)	0
    87)	0
    88)	0
    89)	0
    90)	0
    91)	0
    92)	0
    93)	0
    94)	0
    95)	0
    96)	0
    97)	0
    98)	0
    99)	0
    100)	0
    101)	0
    102)	0
    103)	0
    104)	0
    105)	0
    106)	0
    107)	0
    108)	0
    109)	0
    110)	0
    111)	0
    112)	0
    113)	0
    114)	0
    115)	0
    116)	0
    117)	0
    118)	0
    119)	0
    120)	0
    121)	0
    122)	0
    123)	0
    124)	0
    125)	0
    126)	0
    127)	0

    Regards.

  • Hi,

    See my comment below in the register file.

    Register settings from I2S DIN to HPL/R
    I2C page 0
    reg	data	Comment
    0)	0
    1)	0
    2)	0	fs = fsref/1
    3)	84	PLL enabled with Q=16, P=4. This is not correct for 12MHz MCLK and fsref=48KH, P should be 1. See table 1 on page 24 of datasheet.
    4)	4	J=1, should be 8
    5)	0
    6)	0	D=0, should be 1920
    7)	6A	fsref=48K, Left and right DAC to Left and Right channels respectively
    8)	0	Slave mode
    9)	0	I2S, 16-bit
    10)	33	Why do you need 51 bclk offset? Should be 0 here
    11)	30	R=16, should be 1
    12)	0
    13)	0
    14)	0	Capless driver, your schematic is with cap. Which configuration do you intend to use? See section 11.3.10 in datasheet for more detail.
    15)	0
    16)	0
    17)	0
    18)	0
    19)	0
    20)	0
    21)	0
    22)	0
    23)	0
    24)	40
    25)	6
    26)	0
    27)	0
    28)	0
    29)	0
    30)	0
    31)	0
    32)	0
    33)	0
    34)	0
    35)	0
    36)	11
    37)	E0	Left and Right DAC powered up with HPLCOM as SE output. Your schematic shows HPLCOM as VCOM. Maybe what you want is 0xD0 with capless driver.
    38)	10	Same here, maybe 0x08. If it's with cap then the sleeve is tied to gnd.
    39)	0
    40)	0	Output VCM=1.35
    41)	A0	DAC_L2 and DAC_R2 path
    42)	0
    43)	0	Left DAC not muted with 0dB
    44)	0	Right DAC not muted with 0dB
    45)	0
    46)	0
    47)	0
    48)	0
    49)	0
    50)	0
    51)	F	HPLOUT not muted and powered up with 0dB
    52)	0
    53)	0
    54)	0
    55)	0
    56)	0
    57)	0
    58)	0	HPLCOM muted and not powered
    59)	0
    60)	0
    61)	0
    62)	0
    63)	0
    64)	0
    65)	F	HPROUT not muted and powered up with 0dB
    66)	0
    67)	0
    68)	0
    69)	0
    70)	0
    71)	0	HPRCOM muted and not powered
    72)	0
    73)	0
    74)	0
    75)	0
    76)	0
    77)	0
    78)	0
    79)	0
    80)	0
    81)	0
    82)	0
    83)	0
    84)	0
    85)	0
    86)	0
    87)	0
    88)	0
    89)	0
    90)	0
    91)	0
    92)	0
    93)	0
    94)	C6	DAC and HP are powered up
    95)	0
    96)	0
    97)	0
    98)	0
    99)	0
    100)	0
    101)	0	CODEC_CLKIN uses PLLDIV_OUT
    102)	0	CLKDIV_IN uses MCLK and PLLCLK_IN uses MCLK
    103)	0
    104)	0
    105)	0
    106)	24
    107)	10
    108)	0
    109)	0
    110)	0
    111)	0
    112)	0
    113)	0
    114)	0
    115)	0
    116)	0
    117)	0
    118)	0
    119)	0
    120)	0
    121)	0
    122)	0
    123)	0
    124)	0
    125)	0
    126)	0
    127)	0
    
    I2C page 1
    0)	1
    1)	6B
    2)	E3
    3)	96
    4)	66
    5)	67
    6)	5D
    7)	6B
    8)	E3
    9)	96
    10)	66
    11)	67
    12)	5D
    13)	7D
    14)	83
    15)	84
    16)	EE
    17)	7D
    18)	83
    19)	84
    20)	EE
    21)	39
    22)	55
    23)	F3
    24)	2D
    25)	53
    26)	7E
    27)	6B
    28)	E3
    29)	96
    30)	66
    31)	67
    32)	5D
    33)	6B
    34)	E3
    35)	96
    36)	66
    37)	67
    38)	5D
    39)	7D
    40)	83
    41)	84
    42)	EE
    43)	7D
    44)	83
    45)	84
    46)	EE
    47)	39
    48)	55
    49)	F3
    50)	2D
    51)	53
    52)	7E
    53)	7F
    54)	FF
    55)	0
    56)	0
    57)	0
    58)	0
    59)	0
    60)	0
    61)	0
    62)	0
    63)	0
    64)	0
    65)	7F
    66)	EA
    67)	80
    68)	16
    69)	7F
    70)	D5
    71)	7F
    72)	EA
    73)	80
    74)	16
    75)	7F
    76)	D5
    77)	0
    78)	0
    79)	0
    80)	0
    81)	0
    82)	0
    83)	0
    84)	0
    85)	0
    86)	0
    87)	0
    88)	0
    89)	0
    90)	0
    91)	0
    92)	0
    93)	0
    94)	0
    95)	0
    96)	0
    97)	0
    98)	0
    99)	0
    100)	0
    101)	0
    102)	0
    103)	0
    104)	0
    105)	0
    106)	0
    107)	0
    108)	0
    109)	0
    110)	0
    111)	0
    112)	0
    113)	0
    114)	0
    115)	0
    116)	0
    117)	0
    118)	0
    119)	0
    120)	0
    121)	0
    122)	0
    123)	0
    124)	0
    125)	0
    126)	0
    127)	0

    Your PLL clock should be as shown below.

    Your HP driver is also questionable.

    Regards.

  • Hi,

    It was capless configuration (I shorted the capacitors on the PCB). Following your suggestions, I finally managed to get the sound on the headset. Thank you very much.

    Regards!

  • Good to know.