Hello Everyone
I try to implement an audio function which needs to combine digital microphone (PDM) input and music input (INL/INR) to headphone output (HPL & HPR). And TLV320DAC3203 is chosen to do the combination. I am new with this Codec, currently I am able to output music input to headphone, but have big trouble to output digital microphone (PDM) to Headphone output. From the user guide, I got the data flow should be as the following:
PDM in --> ADC --> DSP --> Audio Interface --> DAC --> HP
So I came out configuration as the following, and cannot hear the sound of digital microphone from the headphone, please help, thanks.
{0x00, 0x00}, // 0. Initialize to page 0
{0x01, 0x01}, // 1. Initialize the device through software reset
{0x04, 0x03}, // 2. Set PLL_CLKIN as MCLK and CODEC_CLKIN as PLL_CLK
{0x05, 0x93}, // 3. Power up pll, set pll divider P=1 and pll divider R=3
{0x06, 0x07}, // 4. Set pll divider J=7
{0x07, 0x00}, // 5. Set pll divider D=0000
{0x08, 0x00}, // 6.
{0x12, 0x87}, // 7. Power up and set NADC divider = 7
{0x13, 0x89}, // 8. Power up and set MDAC divider = 9
{0x14, 0x40}, // 9. Set AOSR = 64
{0x1b, 0x40}, // 10. Set the word length of audio interface to 16 bits, audio interface to DSP
{0x3c, 0x01}, // 11. Set the DAC mode to PRB_P1
{0x00, 0x01}, // 12. Select page 1
{0x01, 0x08}, // 13. Disable internal crude AVdd in presence of external AVdd supply
{0x02, 0x00}, // 14. Enable master analog power control
{0x7b, 0x01}, // 15. Set the REF charging time to 40ms
{0x0a, 0x00}, // 16. Set the input common mode to 0.9V and output common mode for headphone to input common mode
{0x0c, 0x0c}, // 17. Route left DAC & INL to HPL
{0x0d, 0x0c}, // 18. Route right DAC & INR to HPR
{0x03, 0x00}, // 19. Set the DAC PTM mode to PTM_P3
{0x04, 0x00}, // 20.
{0x10, 0x00}, // 21. Set the HPL gain to 0dB
{0x11, 0x00}, // 22. Set the HPR gain to 0dB
{0x14, 0x29}, // 23. HP soft stepping settings for optimal pop performance at power up. Rpop used is 6k with N = 6 & soft step = 20usec
{0x09, 0x30}, // 24. Power up HPL and HPR drivers
{0x00, 0x00}, // 25. Select page 0
{0x41, 0x00}, // 26. Set the left DAC digital volume control to 0 dB
{0x42, 0x00}, // 27. Set the right DAC digital volume control to 0 dB
{0x3f, 0xd6}, // 28. Power up left and right DAC channel, routing left and right audio interface
{0x40, 0x00}, // 29. Unmute the DAC digital volume control
{0x37, 0x0e}, // 30. Configure MISO as clock output for digital microphone
{0x51, 0xdc}, // 31. Power up left ADC and right ADC. Enable digital microphone mode for left ADC and right ADC. Treat data on SCLK as digital microphone data
{0x52, 0x00}};// 32. Unmute left ADC and right ADC