Other Parts Discussed in Thread: CC3200
Tool/software: Code Composer Studio
Hello TI
Pls help me. I need to play an audio file, which I recorded on a SPI FLASH.
using the SPI TRANSFER command, I write the information to g_ucRxBuff (g_ucRxBuff is a circular buffer) then I fill it with the playBuffer. But in response I hear only hiss and squeals. Interestingly, with a different number of bytes sent for iteration in a cycle, the sound changes. What I'm doing is not right, ask me leading questions, I'll definitely answer so that it's easier for you to understand the situation.
In the WIFI_AUDIO_APP example, I completely disabled Speaker_task, and Network_task.
And also I changed Microphone_task this way:
void Microphone( void *pvParameters ) { long lRetVal = -1; unsigned char array_to_send_spi [2]; short page16 = 0x00 ; //RESET SPI MAP_SPIReset(GSPI_BASE); //SPI CONFIG MAP_SPIConfigSetExpClk(GSPI_BASE,MAP_PRCMPeripheralClockGet(PRCM_GSPI), SPI_IF_BIT_RATE,SPI_MODE_MASTER,SPI_SUB_MODE_0, (SPI_SW_CTRL_CS | SPI_4PIN_MODE | SPI_TURBO_OFF | SPI_CS_ACTIVELOW | SPI_WL_8)); if(g_loopback) // g_loopback = 1 { Report("\n \r READING \n \r"); Report("\n \r first page is 0"); array_to_send_spi[0] = (unsigned char)((page16) >> 6); array_to_send_spi[1] = (unsigned char)((page16) << 2); Report("\r"); Report("Page = %d", page16); Report("\r"); MAP_SPIEnable(GSPI_BASE); MAP_SPITransfer(GSPI_BASE,READING,g_ucBuff,1, SPI_CS_ENABLE); MAP_SPITransfer(GSPI_BASE,array_to_send_spi,g_ucBuff,2, SPI_CS_ENABLE); for(i=0; i<242; i++) //528 bytes is size of page. I have 242 pages of data { MAP_SPITransfer(GSPI_BASE,g_ucTxBuff, g_ucRxBuff,528, SPI_CS_ENABLE); FillBuffer(pPlayBuffer, (unsigned char*)(g_ucRxBuff->pucReadPtr), 528); UpdateReadPtr(g_ucRxBuff, 528); MAP_UtilsDelay(1000); } MAP_SPITransfer(GSPI_BASE,g_ucTxBuff, g_ucRxBuff,1, SPI_CS_DISABLE); MAP_UtilsDelay(8000000); MAP_SPIDisable(GSPI_BASE); Report("\r Reading complete \r"); } }
waiting your answer!