AnsweredAssumed Answered

SGTL5000 I2S word length issue

Question asked by victorien on Dec 21, 2016
Latest reply on May 30, 2017 by Pascaline Peyclit

Hi,

I'm trying to use SGTL5000 codec with a CC2511 micro-controller. The I2C and I2S bus work well but I have an issue when I want to change the word length of I2S data (bits DLEN of CHIP_I2S_CTRL register). I configure the register to have 16 bits word length but when I check DOUT, I always see 24 bits of data.

 

Is there someone who have a solution ?

 

The initialization code is this one :

//Power Up
CHECK_ERROR(Codec_WriteRegister(CODEC_CHIP_LINREG_CTRL, 0x0008 ));

CHECK_ERROR(Codec_WriteRegister(CODEC_CHIP_ANA_POWER, 0x7260 ));

CHECK_ERROR(Codec_WriteRegister(CODEC_CHIP_CLK_TOP_CTRL, 0x0800 ));

CHECK_ERROR(Codec_WriteRegister(CODEC_CHIP_ANA_POWER, 0x7A60 ));

CHECK_ERROR(Codec_WriteRegister(CODEC_CHIP_LINREG_CTRL, 0x006C ));

CHECK_ERROR(Codec_WriteRegister(CODEC_CHIP_REF_CTRL, 0x004E ));

CHECK_ERROR(Codec_WriteRegister(CODEC_CHIP_LINE_OUT_CTRL, 0x0322 ));

CHECK_ERROR(Codec_WriteRegister(CODEC_CHIP_REF_CTRL, 0x004F ));

CHECK_ERROR(Codec_WriteRegister(CODEC_CHIP_SHORT_CTRL, 0x1106 ));

CHECK_ERROR(Codec_WriteRegister(CODEC_CHIP_ANA_CTRL, 0x0133 ));

CHECK_ERROR(Codec_WriteRegister(CODEC_CHIP_ANA_POWER, 0x7AFF ));

CHECK_ERROR(Codec_WriteRegister(CODEC_CHIP_DIG_POWER, 0x0073 ));

CHECK_ERROR(Codec_WriteRegister(CODEC_CHIP_LINE_OUT_VOL, 0x0505 ));

//Config I2S
//lrclk = mclk / MCLK_FREQ * RATE_MODE
//bclk = lrclk * SCLKFREQ

CHECK_ERROR(Codec_WriteRegister(CODEC_CHIP_CLK_CTRL, 0x0038 ));
CHECK_ERROR(Codec_WriteRegister(CODEC_CHIP_I2S_CTRL, 0x00B0 ));

//config entrée/sortie
CHECK_ERROR(Codec_WriteRegister(CODEC_CHIP_SSS_CTRL, 0x0010 ));

CHECK_ERROR(Codec_WriteRegister(CODEC_CHIP_ANA_CTRL, 0x0115 ));

//volume control
CHECK_ERROR(Codec_WriteRegister(CODEC_CHIP_ANA_ADC_CTRL, 0x0000 ));

CHECK_ERROR(Codec_WriteRegister(CODEC_CHIP_MIC_CTRL, 0x0001 ));

CHECK_ERROR(Codec_WriteRegister(CODEC_CHIP_ANA_HP_CTRL, 0x0101 ));

CHECK_ERROR(Codec_WriteRegister(CODEC_CHIP_ANA_CTRL, 0x0101 ));

CHECK_ERROR(Codec_WriteRegister(CODEC_CHIP_DAC_VOL, 0x3C3C ));

CHECK_ERROR(Codec_WriteRegister(CODEC_CHIP_ADCDAC_CTRL, 0x0200 ));

CHECK_ERROR(Codec_WriteRegister(CODEC_CHIP_ANA_CTRL, 0x0104 ));

 

Regards

Outcomes