AnsweredAssumed Answered

ADAU1772 codec usage

Question asked by milosoftware on Dec 14, 2012
Latest reply on Mar 24, 2014 by skribtsov

We're evaluating the ADAU1772 codec for use on an embedded linux system.

 

I've built a driver for the 2.6.37 kernel (that we're sort of forced to use).

 

Only the ADC functionality is to be used, purely as a codec. Since the product will be battery powered, keeping the unused portions of the codec inactive is very important. Clocks are provided externally (we will be using multiple codecs in parallel in the product).

 

I'm running into various mysterious problems with it, and hope you can clarify things.

 

Here is the set I send to the chip for capturing (commented-out data is already default):

0x0001,0x00,  // Param Name:  IC 1.PLL_CTRL0 Register
0x0002,0x01,  // Param Name:  IC 1.PLL_CTRL1 Register
0x0003,0x00,  // Param Name:  IC 1.PLL_CTRL2 Register
0x0004,0x00,  // Param Name:  IC 1.PLL_CTRL3 Register
0x0005,0x20,  // Param Name:  IC 1.PLL_CTRL4 Register
0x0006,0x01,  // Param Name:  IC 1.PLL_CTRL5 Register
0x0000,0x17,  // Param Name:  IC 1.CLK_CONTROL Register
0x0007,0x07,  // Param Name:  IC 1.CLKOUT_SEL Register
0x0008,0x01,  // Param Name:  IC 1.REGULATOR Register
// 0x0009,0x04,  // Param Name:  IC 1.CORE_CONTROL Register
// 0x000A,0x00,  // Param Name:  IC 1.SLEEP_INST Register
0x000B,0x00,  // Param Name:  IC 1.CORE_ENABLE Register
// 0x000C,0x00,  // Param Name:  IC 1.ABSREG0 Register
// 0x000D,0x00,  // Param Name:  IC 1.ABSREG1 Register
// 0x000E,0x00,  // Param Name:  IC 1.ABSREG2 Register
// 0x000F,0x10,  // Param Name:  IC 1.CORE_IN_MUX_0_1 Register
// 0x0010,0x32,  // Param Name:  IC 1.CORE_IN_MUX_2_3 Register
// 0x0011,0x10,  // Param Name:  IC 1.DAC_SOURCE_0_1 Register
// 0x0012,0x32,  // Param Name:  IC 1.PDM_SOURCE_0_1 Register
// 0x0013,0x54,  // Param Name:  IC 1.SOUT_SOURCE_0_1 Register
// 0x0014,0x76,  // Param Name:  IC 1.SOUT_SOURCE_2_3 Register
// 0x0015,0x54,  // Param Name:  IC 1.SOUT_SOURCE_4_5 Register
// 0x0016,0x76,  // Param Name:  IC 1.SOUT_SOURCE_6_7 Register
0x0017,0x01,  // Param Name:  IC 1.ADC_SDATA_CH Register
0x0018,0x54,  // Param Name:  IC 1.ASRCO_SOURCE_0_1 Register
0x0019,0x76,  // Param Name:  IC 1.ASRCO_SOURCE_2_3 Register
0x001A,0x02,  // Param Name:  IC 1.ASRC_MODE Register
0x001B,0x00,  // Param Name:  IC 1.ADC_CONTROL0 Register
0x001C,0x00,  // Param Name:  IC 1.ADC_CONTROL1 Register
0x001D,0x03,  // Param Name:  IC 1.ADC_CONTROL2 Register
0x001E,0x03,  // Param Name:  IC 1.ADC_CONTROL3 Register
// 0x001F,0x00,  // Param Name:  IC 1.ADC0_VOLUME Register
// 0x0020,0x00,  // Param Name:  IC 1.ADC1_VOLUME Register
// 0x0021,0x00,  // Param Name:  IC 1.ADC2_VOLUME Register
// 0x0022,0x00,  // Param Name:  IC 1.ADC3_VOLUME Register
0x0023,0x92,  // Param Name:  IC 1.PGA_CONTROL_0 Register
0x0024,0x92,  // Param Name:  IC 1.PGA_CONTROL_1 Register
0x0025,0x92,  // Param Name:  IC 1.PGA_CONTROL_2 Register
0x0026,0x92,  // Param Name:  IC 1.PGA_CONTROL_3 Register
0x0027,0x0F,  // Param Name:  IC 1.PGA_STEP_CONTROL Register
// 0x0028,0x00,  // Param Name:  IC 1.PGA_10DB_BOOST Register
0x0029,0x3F,  // Param Name:  IC 1.POP_SUPPRESS Register
// 0x002A,0x00,  // Param Name:  IC 1.TALKTHRU Register
0x002B,0xFF,  // Param Name:  IC 1.TALKTHRU_GAIN0 Register
0x002C,0xFF,  // Param Name:  IC 1.TALKTHRU_GAIN1 Register
// 0x002D,0x00,  // Param Name:  IC 1.MIC_BIAS Register
// 0x002E,0x18,  // Param Name:  IC 1.DAC_CONTROL1 Register
0x002F,0xFF,  // Param Name:  IC 1.DAC0_VOLUME Register
0x0030,0xFF,  // Param Name:  IC 1.DAC1_VOLUME Register
// 0x0031,0x0F,  // Param Name:  IC 1.OP_STAGE_MUTES Register
0x0032,0x06,  // Param Name:  IC 1.SAI_0 Register
// 0x0033,0x00,  // Param Name:  IC 1.SAI_1 Register
0x0034,0xF0,  // Param Name:  IC 1.SOUT_CONTROL0 Register
// 0x0035,0x00,  // Param Name:  IC 1.SOUT_CONTROL1 Register
// 0x0036,0x00,  // Param Name:  IC 1.PDM_OUT Register
// 0x0037,0x00,  // Param Name:  IC 1.PDM_PATTERN Register
// 0x0038,0x00,  // Param Name:  IC 1.MODE_MP0 Register
0x0039,0x00,  // Param Name:  IC 1.MODE_MP1 Register
// 0x003A,0x00,  // Param Name:  IC 1.MODE_MP2 Register
// 0x003B,0x00,  // Param Name:  IC 1.MODE_MP3 Register
// 0x003C,0x00,  // Param Name:  IC 1.MODE_MP4 Register
// 0x003D,0x00,  // Param Name:  IC 1.MODE_MP5 Register
0x003E,0x00,  // Param Name:  IC 1.MODE_MP6 Register
// 0x003F,0x00,  // Param Name:  IC 1.PB_VOL_SET Register
// 0x0040,0x87,  // Param Name:  IC 1.PB_VOL_CONV Register
0x0041,0x07,  // Param Name:  IC 1.DEBOUNCE_MODE Register
// 0x0042,0x00,  // Param Name:  IC 1.RESERVED Register
0x0043,0x00,  // Param Name:  IC 1.OP_STAGE_CTRL Register
0x0044,0xFF,  // Param Name:  IC 1.DECIM_PWR_MODES Register
// 0x0045,0x00,  // Param Name:  IC 1.INTERP_PWR_MODES Register
// 0x0046,0x00,  // Param Name:  IC 1.BIAS_CONTROL0 Register
// 0x0047,0x00,  // Param Name:  IC 1.BIAS_CONTROL1 Register
// 0x0048,0x7F,  // Param Name:  IC 1.PAD_CONTROL0 Register
// 0x0049,0x1F,  // Param Name:  IC 1.PAD_CONTROL1 Register
// 0x004A,0x00,  // Param Name:  IC 1.PAD_CONTROL2 Register
// 0x004B,0x00,  // Param Name:  IC 1.PAD_CONTROL3 Register
// 0x004C,0x00,  // Param Name:  IC 1.PAD_CONTROL4 Register
// 0x004D,0x00,  // Param Name:  IC 1.PAD_CONTROL5 Register

 

To start recording, I unmute the ADCs (and DACs) and start the clock by setting BIT(0) or register 0, and write "0" to register 0x31.

 

This indeed sends data via I2C to my main CPU which looks correct. Displaying the result in a wave editor also corresponds to the input.

 

Something that puzzles me:

-?- If I disable the DAC output, because we don't need them, I get no ADC data from the device.

-?- Changing the ADC volumes via registers 0x1f tru 0x22 has no effect whatsoever, there's no difference in the recorded signal.

 

Is there some kind of "application note" that explains how to accomplish various task with the chip? The datasheet gives all the details, but fails to explain how various things on the chip interact.

Outcomes