Hello there.
Currently I´m working on TLV320AIC3120 firmware, and having trouble with its configuration, I´ve started with the below template coommands:
//###############################################
//# Software Reset
//###############################################
//#
//# Select Page 0
iic_WriteReg( 0, 0);
//#
//# Initialize the device through software reset/
iic_WriteReg( 1, 1);
//#
//###############################################
//###############################################
//# Clock and Interface Settings
//# ---------------------------------------------
//# The codec receives: MCLK = 11.2896 MHz,
//# BLCK = 2.8224 MHz, WCLK = 44.1 kHz
//###############################################
//#
//# Select Page 0
iic_WriteReg( 0, 0);
//#
//# PLL_clkin = MCLK, codec_clkin = PLL_CLK,
//# PLL on, P=1, R=1, J=8, D=0000
iic_WriteReg( 4, 3);
iic_WriteReg( 5, 0x91);
iic_WriteReg( 6, 0x08);
iic_WriteReg( 7, 0);
iic_WriteReg( 8, 0);
//#
//# NDAC = 2, MDAC = 8, dividers powered on
iic_WriteReg( 0x0b, 0x82);
iic_WriteReg( 0x0c, 0x88);
//#
//# DOSR = 128
iic_WriteReg (0x0D, 0) ;
iic_WriteReg (0x0E, 0x80);
//#
//# NADC = 2, MADC = 8, dividers powered on
iic_WriteReg(0x12 ,0x82);
iic_WriteReg(0x13 ,0x88);
//#
//# AOSR = 128
iic_WriteReg( 0x14, 0x80);
//#
//###############################################
//###############################################
//# Signal Processing Settings
//###############################################
//#
//# Select Page 0
iic_WriteReg( 0x00, 0x00);
//#
//# PRB_P5, PRB_R5
iic_WriteReg( 0x3c, 0x05);
iic_WriteReg( 0x3d, 0x05);
//#
//# Enable Adaptive Filtering
iic_WriteReg( 0x00, 0x08);
iic_WriteReg( 0x01, 0x04);
//#
//###############################################
//##########################################
//# Configure Class-D Output
//##########################################
//#
//# Switch to Page 1
iic_WriteReg(0x00, 0x01);
//#
//# CM = 1.65V
iic_WriteReg( 0x1f, 0x14);
//#
//# Unmute Class-D (6dB)
//iic_WriteReg 2a 04
//# Unmute Class-D (12dB)
//# iic_WriteReg 2a 0c
//# Unmute Class-D (18dB)
//# iic_WriteReg 2a 14
//# Unmute Class-D (24dB)
iic_WriteReg(0x2a, 0x1c);
//#
//# Power-up Class-D driver
iic_WriteReg( 0x20, 0x86);
//#
//# Route Analog Volume Control to Class-D Driver, 0dB
iic_WriteReg( 0x26, 0x80);
//#
//##########################################
//##########################################
//# Configure HP Output
//##########################################/
//#
//# Switch to Page 1
iic_WriteReg( 0x00, 0x01);
//#
//# De-pop, Power on = 800 ms, Step time = 4 ms
iic_WriteReg( 0x21, 0x4e);
//#
//# Route Analog Volume Control to HP Driver, 0dB
iic_WriteReg( 0x24, 0x80);
//#
//# HP output powered up, current limit
iic_WriteReg( 0x1f, 0x84);
//#
//# HP unmute and gain 0db
iic_WriteReg( 0x28, 0x06);
//#
//##########################################
//##########################################
//# Configure DAC Channel
//##########################################
//#
//# Switch to Page 1
iic_WriteReg( 0x00, 0x01);
//#
//# DAC routed to Mixer Amplifier
iic_WriteReg(0x23, 0x00);
//#
//# Switch to Page 0
iic_WriteReg(0x00, 0x00);
//#
//# Powerup DAC, DAC => LI2S, soft-step disable
iic_WriteReg( 0x3f, 0x96);
//#
//# Unmute DAC, 0dB
iic_WriteReg( 0x40, 0x04);
iic_WriteReg( 0x41, 0x30);
//#
//##########################################
I2C communication appears to be ok since I can read the page with the values that i Put, I2S was already tested with another codec and seems to be ok too. Sp when I terminate the config step, my Audio task apply audio via I2S and volume is maximized but no audio output on speaker amplifier.
We checked:
- The speaker amplifier powers up, we hear the "pop";
- The clocks are ok too, we configured the GPIO to output the clocks configured to produce a Fs = 44100Hz;
- Read the DAC routing registers, and it be correct;
- Performed DAC unmute too;
- Maximum gain on analog volume and amplifier gain;
- Configured the signal processing blocks to use the more simple in order to test (biquads in all pass, and the less aggressive interpolator filter);
What I am missing? Thanks in advance for the help.
Felipe