Tool/software: TI C/C++ Compiler
Hello, TI !
Please help me
I use the example of the WiFi audio App, I need to change the configuration of the audio codec. The sound that I'm trying to reproduce has parameters of 8 KHz 8 bit mono.
I tried to use these parameters:
PLL_J = 40
PLL_R = 6
PLL_P = 1
PLL_D = 0
NDAC = 12
MDAC = 10
DOSR = 128
NADC = 12
MADC = 10
AOSR = 128
With these parameters, I can hear sound with a 16 kHz descritisation frequency, but I cannot hear sound with a 8 kHz descritisation frequency. Instead of 8 kHz sound, I hear a nasty noise. I'm trying to reproduce the 8 bit 8 kHz mono sound and I use this audio codec configuration:
audiocodec.c:
int AudioCodecConfig(unsigned char codecId, unsigned char bitsPerSample, unsigned short bitRate, unsigned char noOfChannels, unsigned char speaker, unsigned char mic) { unsigned int bitClk = 0; if(codecId == AUDIO_CODEC_TI_3254) { AudioCodecPageSelect(TI3254_PAGE_0); if(bitsPerSample == AUDIO_CODEC_8_BIT) //AUDIO_CODEC_16_BIT { // Set I2S Mode and Word Length AudioCodecRegWrite(TI3254_AUDIO_IF_1_REG, 0x00); } else { return -1; } bitClk = 64000; if(bitClk == 64000) //512000 { AudioCodecPageSelect(TI3254_PAGE_0); AudioCodecRegWrite(TI3254_CLK_MUX_REG, 0x03); // PLL Clock is CODEC_CLKIN 0x03 AudioCodecRegWrite(TI3254_CLK_PLL_P_R_REG, 0x96); // PLL is powered up, P=1, R=6 AudioCodecRegWrite(TI3254_CLK_PLL_J_REG, 0x28); // J=40 AudioCodecRegWrite(TI3254_CLK_PLL_D_MSB_REG, 0x00); // D = 0 AudioCodecRegWrite(TI3254_CLK_NDAC_REG, 0x8C); // NDAC divider powered up, NDAC = 12 AudioCodecRegWrite(TI3254_CLK_MDAC_REG, 0x8A); // MDAC divider powered up, MDAC = 10 AudioCodecRegWrite(TI3254_DAC_OSR_MSB_REG, 0x00); // DOSR = 0x0080 = 128 AudioCodecRegWrite(TI3254_DAC_OSR_LSB_REG, 0x80); // DOSR = 0x0080 = 128 AudioCodecRegWrite(TI3254_CLK_NADC_REG, 0x8C); // NADC divider powered up, NADC = 12 AudioCodecRegWrite(TI3254_CLK_MADC_REG, 0x8A); // MADC divider powered up, MADC = 10 AudioCodecRegWrite(TI3254_ADC_OSR_REG, 0x80); // AOSR = 128 ((Use with PRB_R1 to PRB_R6, ADC Filter Type A) } else { return -1; } // Configure Power Supplies AudioCodecPageSelect(TI3254_PAGE_1); //Select Page 1 AudioCodecRegWrite(TI3254_PWR_CTRL_REG, 0x08); // Disabled weak connection of AVDD with DVDD AudioCodecRegWrite(TI3254_LDO_CTRL_REG, 0x01); // Over Current detected for AVDD LDO AudioCodecRegWrite(TI3254_ANALOG_IP_QCHRG_CTRL_REG, 0x32); // Analog inputs power up time is 6.4 ms AudioCodecRegWrite(TI3254_REF_PWR_UP_CTRL_REG, 0x01); // Reference will power up in 40ms when analog blocks are powered up
main:
AudioCodecReset(AUDIO_CODEC_TI_3254, NULL); // Configure Audio Codec AudioCodecConfig(AUDIO_CODEC_TI_3254, AUDIO_CODEC_8_BIT, 8000, AUDIO_CODEC_MONO, AUDIO_CODEC_SPEAKER_ALL, AUDIO_CODEC_MIC_NONE)
i2s_if.c:
void AudioCaptureRendererConfigure(unsigned char bitsPerSample, unsigned short bitRate, unsigned char noOfChannels, unsigned char RxTx, unsigned char dma) { unsigned long bitClk; bitClk = bitsPerSample * bitRate * noOfChannels; if(dma) { if(bitsPerSample == 8) { MAP_PRCMI2SClockFreqSet(5120000); MAP_I2SConfigSetExpClk(I2S_BASE,5120000,512000,I2S_SLOT_SIZE_16| I2S_PORT_DMA); } } if(RxTx == I2S_MODE_RX_TX) { MAP_I2SSerializerConfig(I2S_BASE,I2S_DATA_LINE_1,I2S_SER_MODE_RX, I2S_INACT_LOW_LEVEL); } if(RxTx & I2S_MODE_TX) { MAP_I2SSerializerConfig(I2S_BASE,I2S_DATA_LINE_0,I2S_SER_MODE_TX, I2S_INACT_LOW_LEVEL); } }
here all the changes I made to complete the task. But every time I hear a 16 bit 16 kHz stereo sound, instead of the 8 bit 8 kHz mono I need. What could be the problem, any advice will help me
Thank you for your help.
George