Sgtl5000 Configuration for high frequency.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Sgtl5000 Configuration for high frequency.

627 Views
nishantpashine
Contributor I

I'm trying to connect SGTL5000 to receive mic data for frequency between 15Khz to 20 Khz but not able to do.

As per my configuration it is taking data well in range of voice and around 2Khz to 3Khz.

Kindly help to meet the requirement of 15Khz to 20Khz frequency input and share the configuration of sgtl5000 for same.

below is my code.

void sgtl_5000_init(void)
{
send_i2c(CHIP_ANA_POWER, 0x4060);
send_i2c(CHIP_LINREG_CTRL, 0x006C); // VDDA & VDDIO both over 3.1V
send_i2c(CHIP_REF_CTRL, 0x01F2); // VAG=1.575, normal ramp, +12.5% bias current
send_i2c(CHIP_LINE_OUT_CTRL, 0x0F22); // LO_VAGCNTRL=1.65V, OUT_CURRENT=0.54mA
send_i2c(CHIP_SHORT_CTRL, 0x4446); // allow up to 125mA
send_i2c(CHIP_ANA_CTRL, 0x0137); // enable zero cross detectors
send_i2c(CHIP_ANA_POWER, 0x40FF); // power up: lineout, hp, adc, dac
send_i2c(CHIP_DIG_POWER, 0x0073); // power up all digital stuff=0x0073 //DAP OFF=0x0063
delay_ms(400);
send_i2c(CHIP_LINE_OUT_VOL, 0x1D1D); // default approx 1.3 volts peak-to-peak
send_i2c(CHIP_CLK_CTRL, 0x0004); // 44.1 kHz, 256*Fs SYS_FS specifies the rate 0x1 = Rate is 1/2 of the SYS_FS rate
send_i2c(CHIP_I2S_CTRL, 0x0130); // SCLK=32*Fs, 16bit, I2S format //16bit
// default signal routing is ok?
send_i2c(CHIP_SSS_CTRL, 0x0013); // ADC->I2S, I2S->DAC(0x0010) Default (0x0000)= MIC IN to ADC
send_i2c(CHIP_ADCDAC_CTRL, 0x0000); // disable dac mute
send_i2c(CHIP_DAC_VOL, 0x3C3C); // digital gain, 0dB
send_i2c(CHIP_ANA_HP_CTRL, 0x7F7F); // set volume (lowest level)
send_i2c(CHIP_ANA_CTRL, 0x0036); // enable zero cross detectors 0x0026 0x0036 (0x0022)=ADC input is MIC.

//send_i2c(CHIP_PAD_STRENGTH,0x0000);

send_i2c(DAP_CONTROL,0x0011); //DAP CONTROL
send_i2c(DAP_PEQ, 0x0007);
send_i2c(DAP_AUDIO_EQ, 0x0001);
send_i2c(DAP_AVC_THRESHOLD, 0x0A40);
send_i2c(DAP_AVC_ATTACK, 0x0014);
send_i2c(DAP_AVC_DECAY , 0x0028);
send_i2c(DAP_AVC_CTRL, 0x0001);
send_i2c(DAP_BASS_ENHANCE,0x0040);
//send_i2c(DAP_BASS_ENHANCE_CTRL , 0x1F3F);
delay_ms(100);
//send_i2c(CHIP_ANA_HP_CTRL, 0x0101); // set volume (11.5db both channel)
/*send_i2c(CHIP_LINREG_CTRL,0x0008);
send_i2c(CHIP_ANA_POWER,0x7260);
send_i2c(CHIP_ANA_POWER,0x4260);
send_i2c(CHIP_CLK_TOP_CTRL,0x0800);
send_i2c(CHIP_ANA_POWER,0x4A60);
send_i2c(CHIP_LINREG_CTRL,0x006C);
send_i2c(CHIP_REF_CTRL,0x004E);
send_i2c(CHIP_LINE_OUT_CTRL,0x322);
send_i2c(CHIP_REF_CTRL,0x004F);
send_i2c(CHIP_SHORT_CTRL,0x1106);
send_i2c(CHIP_ANA_CTRL,0x0133);
send_i2c(CHIP_ANA_POWER,0x6AFF);
send_i2c(CHIP_DIG_POWER,0x0073);*/
}

void input_init(bool n)
{
if(n==0)
{
send_i2c(CHIP_MIC_CTRL,0x0133); // mic preamp gain = +40dB last 2 means +30db
send_i2c(CHIP_ANA_ADC_CTRL,0x00FF); // input gain +12dB (is this enough?) 3 byte 1 to drop the gain to -6db
send_i2c(CHIP_ANA_CTRL,(0x0036 & ~(1<<2))); // enable mic
}
else
{
//send_i2c(CHIP_ANA_ADC_CTRL,0x0055); // +7.5dB gain (1.3Vp-p full scale)
send_i2c(CHIP_ANA_ADC_CTRL,0x0100);
send_i2c(CHIP_ANA_CTRL,(0x0036 | (1<<2))); // enable linein
}


Labels (1)
0 Kudos
Reply
1 Reply

548 Views
igorpadykov
NXP Employee
NXP Employee

Hi nishant

one can check recommendations for programming given in AN3663

Ultra-Low-Power Audio Codec|NXP 

linux sgtl5000 codes

Microphone input on the SABRE Lite and Nitrogen6x - Boundary Devices 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply