WAV/PCM recorder suggestions for SPI speed or clock

Writing software that controls the system and peripherals such as displays, SD cards, Buttons, LEDs, Serial Ports etc.
Post Reply
lorenzo318
User
Posts: 8
Joined: Mon 2021-03-01 23:01

WAV/PCM recorder suggestions for SPI speed or clock

Post by lorenzo318 »

Hi all,

I have the following problem.

I have followed the PCM/WAV documentation to configure the codec in order to record 24kHz/16 bit sample/2 channel.

The samples are taken via SPI using HDAT0/HDAT1 registers.

The SCI_CLOCK register is 0xC000 and a Load the correct plugin from vls site.

// Executing something like this
uint16_t tempBuffer[48000]; // --> 24kHz*2 channels = 48000 words (16 bits each word)
for(int i = 0; i < 48000; i++)
{
if(musicPlayer.recordedWordsWaiting() > 0)
{
tempBuffer = musicPlayer.recordedReadWord();
}
else
{
// Never goes here.
Serial.println("Not read");
//delay(1);
}
}

What it happens is to receive 48000 words each 9 seconds!!

In the WAV header provided by the codec there is 24kHz.

Any suggestions?

Thanks a lot,
BR.
lorenzo318
User
Posts: 8
Joined: Mon 2021-03-01 23:01

Re: WAV/PCM recorder suggestions for SPI speed or clock

Post by lorenzo318 »

Times measured (milliseconds) from begin of registration:

9880 second found
19072 second found
28263 second found
37455 second found
46646 second found
55838 second found
65029 second found
74221 second found
83412 second found
92604 second found
101795 second found
110987 second found
120178 second found
129370 second found
138561 second found
User avatar
pasi
VLSI Staff
Posts: 1783
Joined: Thu 2010-07-15 16:04

Re: WAV/PCM recorder suggestions for SPI speed or clock

Post by pasi »

How are you starting the encoding mode?

Edit: Ah, apparently here: viewtopic.php?f=8&t=2763
Seems resolved.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
Post Reply