Hello everyone,
I am working on DM37x EVM. I want to capture audio from MIC and enable Sidetone. From schematics, I saw that P11 is connected to AUXR and AUXL.
I configured codec in the following way:
VOID Codec_Init()
{
uint8_t buf;
Audio_PMIC_Write(0x49, 0x01, 0x00); //Option 2 enabled. Sample at 8kHz.
Audio_PMIC_Write(0x49, 0x17, 0x10); //Enable voice DAC.
Audio_PMIC_Write(0x49, 0x3A, 0x16); //APLL frequency 26MHz. Enable APLL.
Audio_PMIC_Write(0x49, 0x44, 0x03); //Enable voice digital to analog path.
Audio_PMIC_Write(0x49, 0x02, 0x1C); //Enable voice TX and RX paths.
Audio_PMIC_Write(0x49, 0x0F, 0x63); //Voice input and output enable. Enable Voice communication.
Audio_PMIC_Write(0x49, 0x3F, 0x00); //PCM and bluetooth mux settings.
Audio_PMIC_Write(0x49, 0x14, 0x11); //Voice receive gain.
Audio_PMIC_Write(0x49, 0x22, 0x09); //Enable voice on HSOR and HSOL.
Audio_PMIC_Write(0x49, 0x06, 0x14); //Enable AUXR. Enable MIC amplifier.
Audio_PMIC_Write(0x49, 0x07, 0x0A); //Enable ADC left and right.
Audio_PMIC_Write(0x49, 0x08, 0x00); //ADC input routed to TXL1, TXL2, TXR1, TXR2
Audio_PMIC_Write(0x49, 0x0C, 0x00); //AVTXL2PGA.
Audio_PMIC_Write(0x49, 0x0D, 0x00); //AVTXR2PGA.
Audio_PMIC_Write(0x49, 0x48, 0x09); //Mic amplifier gain.
Audio_PMIC_Write(0x49, 0x44, 0x03); //Enable digital to analog path and enable analog PGA.
Audio_PMIC_Write(0x49, 0x49, 0x7E); //Disable voice filters.
Audio_PMIC_Write(0x49, 0x0E, 0x09); //Enable audio interface.
Audio_PMIC_Write(0x49, 0x15, 0x29); //Enable sidetone and program its gain.
Audio_PMIC_Write(0x49, 0x18, 0x3F); //ARX2VTXPGA.
Audio_PMIC_Write(0x49, 0x2F, 0x01); //Enable soft volume.
Audio_PMIC_Write(0x49, 0x2B, 0x00); //Disable ALC.
Audio_PMIC_Write(0x49, 0x01, 0x02); //Power on codec so that changes take effect.
Audio_PMIC_Write(0x49, 0x05, 0xD4); //Enable AUXL. Enable MIC amplifier. Start offset cancellation.
do
{
Audio_PMIC_Read(0x49, 0x05, &buf); //Wait for offset cancellation to complete.
}while(buf & (1<<8));
Audio_PMIC_Write(0x49, 0x24, 0x40); //VMID enable.
Audio_PMIC_Write(0x49, 0x23, 0x0a); //Headset gain.
Audio_PMIC_Read(0x49, 0x24, &buf);
Audio_PMIC_Write(0x49, 0x24, buf|0x02); //Ramp enable.
}
When I read DRR, I always get data like:
7f06
200000
ff08
7f02
7eef
7f0c
7f00
7f0b
ff04
7ef0
7efd
ff0a
7f09
7f01
7f06
7efb
7f08
7f07
7f0d
ff07
7f0b
7ef6
7f03
7f10
7f04
7f0b
7ef8
7eef
7f0e
7f04
ff0d
7f00
7eef
7f0b
0
0
7f0e
ff07
7efa
ff0d
7f08
ff0f
ff07
7ef9
7eef
7f09
7f03
7f0b
7f03
7ef5
7ef9
Also, Sidetone is not working. What I speak in MIC do not loopback to the headphones.
Can anyone help me in this regard??
Umair
