Hello All,
I am using a Cortex-M4 (STM32, not Teensy) with Teensy Audio board. The Teensy is powered by "jumper wires" from the main board. The configuration setting is given at end of my query.
I get a constant noise in my capture. Assuming the I2S was in error, I did SGTL Internal Loopback but the noise continues. Tried both synchronous and asynchronous mode. The audio is configured for 8KHz sampling as per our algorithm requirement.
The noise continued in both asynchronous and synchronous (2.048MHz clock (MCLK) input - again sourced from the Cortex-M4 or 12MHz (PLL mode).
Then, after lot of hair-pulling, I today changed BIAS_CTRL to -37.5% and the noise reduced significantly but still not reduced.
I tried adding a 0.1uF to the MIC pin, but the noise is still present. I am now trying only the loopback at the chip and unable to find a way forward...
Any help/ direction appreciated.
Thanks,
---- My configuration-----
static void ConfigureSgtl()
{
// Value which is used in Bitbucket code with PLL
uint32_t delay;
SgtlRegWrite(SGTL5000_CHIP_ANA_POWER, 0x4060); // Power down everything but ADC, DAC and Ref Currents Power Up
SgtlRegWrite(SGTL5000_CHIP_LINREG_CTRL, 0x006C); // Manually assign charge pump source to VDDIO
SgtlRegWrite(SGTL5000_CHIP_REF_CTRL, 0x001F2); // Set VAG = 1.575
SgtlRegWrite(SGTL5000_CHIP_LINE_OUT_CTRL, 0x0000);// No-op
SgtlRegWrite(SGTL5000_CHIP_SHORT_CTRL, 0x4446); // Disable short control
SgtlRegWrite(SGTL5000_CHIP_ANA_CTRL, 0x0122); // Unmute DAC/ADC and select proper sources for mic/headphone
SgtlRegWrite(SGTL5000_CHIP_PLL_CTRL,0x8312);
#ifdef USE_MONO_CHANNEL
SgtlRegWrite(SGTL5000_CHIP_ANA_POWER, 0x53A); // Power down everything but mic, dac, HP,
SgtlRegWrite(SGTL5000_CHIP_ANA_POWER, 0x5BA); // Enable VAG
#else
SgtlRegWrite(SGTL5000_CHIP_ANA_POWER, 0x457A); // Power down everything but mic, dac, HP,
SgtlRegWrite(SGTL5000_CHIP_ANA_POWER, 0x45FA); // Enable VAG
#endif
SgtlRegWrite(SGTL5000_CHIP_DIG_POWER, 0x0063); // ADC, DAC, I2S_IN, I2S_OUT
delay = 1000000u;
while(--delay);
SgtlRegWrite(SGTL5000_CHIP_LINE_OUT_VOL, 0x0F0F); // Max out the attenuation for line out
SgtlRegWrite(SGTL5000_CHIP_CLK_CTRL, 0x003B); // Fs = 48/6 KHz, MCLK=256*Fs
SgtlRegWrite(SGTL5000_CHIP_I2S_CTRL, 0x01B0); // 16-bit, Master, SCLK = 32Fs,
SgtlRegWrite(SGTL5000_CHIP_SSS_CTRL, 0x0010); // I2S_IN->DAC, ADC->I2S_OUT
SgtlRegWrite(SGTL5000_CHIP_ADCDAC_CTRL, 0x0000);
SgtlRegWrite(SGTL5000_CHIP_DAC_VOL, 0x3C3C); // 0dB for both channels
SgtlRegWrite(SGTL5000_CHIP_ANA_HP_CTRL, 0x0C0C); // 0dB volume in both HP channels
SgtlRegWrite(SGTL5000_CHIP_ANA_ADC_CTRL, 0x0000); // No loss in ADC volume
SgtlRegWrite(SGTL5000_CHIP_MIC_CTRL, 0x0170); // MIC BIAS output impedance 2kOhm, BiasV = 3V, ampli gain = +0dB
SgtlRegWrite(SGTL5000_CHIP_CLK_TOP_CTRL, 0x0000); // Disable the internal osc
SgtlRegWrite(SGTL5000_DAP_CTRL, 0x0000); // Disable DAP
}
I am using a Cortex-M4 (STM32, not Teensy) with Teensy Audio board. The Teensy is powered by "jumper wires" from the main board. The configuration setting is given at end of my query.
I get a constant noise in my capture. Assuming the I2S was in error, I did SGTL Internal Loopback but the noise continues. Tried both synchronous and asynchronous mode. The audio is configured for 8KHz sampling as per our algorithm requirement.
The noise continued in both asynchronous and synchronous (2.048MHz clock (MCLK) input - again sourced from the Cortex-M4 or 12MHz (PLL mode).
Then, after lot of hair-pulling, I today changed BIAS_CTRL to -37.5% and the noise reduced significantly but still not reduced.
I tried adding a 0.1uF to the MIC pin, but the noise is still present. I am now trying only the loopback at the chip and unable to find a way forward...
Any help/ direction appreciated.
Thanks,
---- My configuration-----
static void ConfigureSgtl()
{
// Value which is used in Bitbucket code with PLL
uint32_t delay;
SgtlRegWrite(SGTL5000_CHIP_ANA_POWER, 0x4060); // Power down everything but ADC, DAC and Ref Currents Power Up
SgtlRegWrite(SGTL5000_CHIP_LINREG_CTRL, 0x006C); // Manually assign charge pump source to VDDIO
SgtlRegWrite(SGTL5000_CHIP_REF_CTRL, 0x001F2); // Set VAG = 1.575
SgtlRegWrite(SGTL5000_CHIP_LINE_OUT_CTRL, 0x0000);// No-op
SgtlRegWrite(SGTL5000_CHIP_SHORT_CTRL, 0x4446); // Disable short control
SgtlRegWrite(SGTL5000_CHIP_ANA_CTRL, 0x0122); // Unmute DAC/ADC and select proper sources for mic/headphone
SgtlRegWrite(SGTL5000_CHIP_PLL_CTRL,0x8312);
#ifdef USE_MONO_CHANNEL
SgtlRegWrite(SGTL5000_CHIP_ANA_POWER, 0x53A); // Power down everything but mic, dac, HP,
SgtlRegWrite(SGTL5000_CHIP_ANA_POWER, 0x5BA); // Enable VAG
#else
SgtlRegWrite(SGTL5000_CHIP_ANA_POWER, 0x457A); // Power down everything but mic, dac, HP,
SgtlRegWrite(SGTL5000_CHIP_ANA_POWER, 0x45FA); // Enable VAG
#endif
SgtlRegWrite(SGTL5000_CHIP_DIG_POWER, 0x0063); // ADC, DAC, I2S_IN, I2S_OUT
delay = 1000000u;
while(--delay);
SgtlRegWrite(SGTL5000_CHIP_LINE_OUT_VOL, 0x0F0F); // Max out the attenuation for line out
SgtlRegWrite(SGTL5000_CHIP_CLK_CTRL, 0x003B); // Fs = 48/6 KHz, MCLK=256*Fs
SgtlRegWrite(SGTL5000_CHIP_I2S_CTRL, 0x01B0); // 16-bit, Master, SCLK = 32Fs,
SgtlRegWrite(SGTL5000_CHIP_SSS_CTRL, 0x0010); // I2S_IN->DAC, ADC->I2S_OUT
SgtlRegWrite(SGTL5000_CHIP_ADCDAC_CTRL, 0x0000);
SgtlRegWrite(SGTL5000_CHIP_DAC_VOL, 0x3C3C); // 0dB for both channels
SgtlRegWrite(SGTL5000_CHIP_ANA_HP_CTRL, 0x0C0C); // 0dB volume in both HP channels
SgtlRegWrite(SGTL5000_CHIP_ANA_ADC_CTRL, 0x0000); // No loss in ADC volume
SgtlRegWrite(SGTL5000_CHIP_MIC_CTRL, 0x0170); // MIC BIAS output impedance 2kOhm, BiasV = 3V, ampli gain = +0dB
SgtlRegWrite(SGTL5000_CHIP_CLK_TOP_CTRL, 0x0000); // Disable the internal osc
SgtlRegWrite(SGTL5000_DAP_CTRL, 0x0000); // Disable DAP
}