16kHz Linear PCM recording vs1053b

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

16kHz Linear PCM recording vs1053b

Post by lorenzo318 »

Hi all,

I've followed the official datasheet downloaded from vlsi pages in order to configure registers to record 16kHz linear PCM (section 9.8.1 Activating ADPCM Mode).

Just to say tha OGGVorbis recording and WAV/PCM 24kHz works very well. But I need 16kHz for application requirements.

Unfortunately, what section 9.8.1 states doesn't work to me.

I tried:

1) SCI_MODE with RESET and without RESET
2) The official patch IMAFix and the WriteVS10xxPatch() indicated in the above section.

No results. The DREQ pin is correct but the SCI_HDAT1 contains always ZERO words.

Could you please help me saying what I've done wrong in the following code?

write_register(SCI_CLOCKF, 0xC000);
vTaskDelay(1/portTICK_PERIOD_MS);

while (!gpio_get_level(CONFIG_GPIO_DREQ_NUM));
write_register(SCI_BASS, 0);
softReset();
vTaskDelay(1/portTICK_PERIOD_MS);
while (!gpio_get_level(CONFIG_GPIO_DREQ_NUM));
write_register(SCI_AIADDR, 0);

write_register(SCI_AICTRL0, 16000U);
write_register(SCI_AICTRL1, 1024);
write_register(SCI_AICTRL2, 0);
write_register(SCI_AICTRL3, 0);
while (!gpio_get_level(CONFIG_GPIO_DREQ_NUM));
write_register(SCI_MODE, SM_SDINEW | SM_ADPCM); <---- Without or with SM_RESET
while (!gpio_get_level(CONFIG_GPIO_DREQ_NUM));
LoadUserCodeIMA();
vTaskDelay(1/portTICK_PERIOD_MS);
while (!gpio_get_level(CONFIG_GPIO_DREQ_NUM));

The LoadUserCodeIMA() function loads the plugin:

vs1053b-imafix110/imafix.plg.

Thanks a lot for any help!!

BR
lorenzo318
Senior User
Posts: 75
Joined: Mon 2021-03-01 23:01

Re: 16kHz Linear PCM recording vs1053b

Post by lorenzo318 »

I changed a little bit my code in the following way and the recording starts. But the signal is very noisy like noise added on the michrophone signal.

Could you help me please?

write_register(&audioDevice, SCI_MODE, SM_SDINEW | SM_ADPCM);
while (!gpio_get_level(CONFIG_GPIO_DREQ_NUM));

write_register(SCI_CLOCKF, 0xC000);
write_register(SCI_BASS, 0);
write_register(SCI_AICTRL0, 16000);
write_register(SCI_AICTRL1, 1024);
write_register(SCI_AICTRL2, 1024);
write_register(SCI_AICTRL3, 4);
write_register(SCI_AIADDR, 0);

LoadUserCodeIMA();

vTaskDelay(1/portTICK_PERIOD_MS);
while (!gpio_get_level(CONFIG_GPIO_DREQ_NUM));

Best regards
lorenzo318
Senior User
Posts: 75
Joined: Mon 2021-03-01 23:01

Re: 16kHz Linear PCM recording vs1053b

Post by lorenzo318 »

I managed my problem.

Thanks anyway!
Post Reply