STM32 SPI and VLSI?

Writing software for systems that use VLSI Solution's devices as slave codecs to a host microcontroller.
Post Reply
bianchi
Senior User
Posts: 245
Joined: Mon 2013-12-30 4:15

STM32 SPI and VLSI?

Post by bianchi »

Hello Everybody,

I tried using VS1053 with STM32
1KHz and Hello test are passed,

but when I read from SDIO sdcard, it can run but I got only a noise, sometimes I can hear the voice properly sometimes it's off...
Is it matter of speed between SDIO (24 MHz) and SPI Prescaler / 2 ?
What's the maximum SPI speed for VS1053 ?

Thanks
User avatar
pasi
VLSI Staff
Posts: 2120
Joined: Thu 2010-07-15 16:04

Re: STM32 SPI and VLSI?

Post by pasi »

CLKI/4 for writes, CLKI/7 for reads from SCI.

After reset 1.0x 12.288MHz - 3MHz for writes, 1.7MHz for reads.
After writing CLOCKF, for example at 4.5x 12.288MHz - 13.8MHz for writes, and 8.3MHz for reads.

So 24MHz would be too high.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
bianchi
Senior User
Posts: 245
Joined: Mon 2013-12-30 4:15

Re: STM32 SPI and VLSI?

Post by bianchi »

So I must reduce my SDIO clock and SPI clock do you reckon ?
SDIO = 2MHz and SPI = 2MHz ?
bianchi
Senior User
Posts: 245
Joined: Mon 2013-12-30 4:15

Re: STM32 SPI and VLSI?

Post by bianchi »

Should the speed between SPI1 and SDIO match ?
On my atmega128 I shared between SDcard and VS1053 and they are on the same speed.
bianchi
Senior User
Posts: 245
Joined: Mon 2013-12-30 4:15

Re: STM32 SPI and VLSI?

Post by bianchi »

I put value CLOCKF = 0x8800, what's the best SPI frequency for it ? my Xtal is 12.28MHz
bianchi
Senior User
Posts: 245
Joined: Mon 2013-12-30 4:15

Re: STM32 SPI and VLSI?

Post by bianchi »

so it's 3.5 x 12.288 ?
User avatar
pasi
VLSI Staff
Posts: 2120
Joined: Thu 2010-07-15 16:04

Re: STM32 SPI and VLSI?

Post by pasi »

You can have different SPI clock for SD and VS10xx.

for 3.5x 12.288MHz you can have 6Mbit/sec read and 10Mbit/sec write.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
bianchi
Senior User
Posts: 245
Joined: Mon 2013-12-30 4:15

Re: STM32 SPI and VLSI?

Post by bianchi »

pasi wrote:You can have different SPI clock for SD and VS10xx.

for 3.5x 12.288MHz you can have 6Mbit/sec read and 10Mbit/sec write.
Can it be slower than the other one ?
For example SPI speed VS1053 is slower than SDIO transfer for SDCard or vice versa ?

I got already the voice but it's not clear, looks like the data is chasing each other between SPI and SDIO ???
It's working ok already with 1KHz and Hello test, and SDIO is working ok on standalone reading a file, but when I combine...no luck yet ...

my CLOCKF value is 0x8800 ==> it's 3.5x 12.288MHz, correct me if I'm wrong ?
User avatar
pasi
VLSI Staff
Posts: 2120
Joined: Thu 2010-07-15 16:04

Re: STM32 SPI and VLSI?

Post by pasi »

Yes, the clock for VS10xx can differ from the clock of other SPI devices.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
Ali Sh
User
Posts: 1
Joined: Fri 2021-08-13 11:09

Re: STM32 SPI and VLSI?

Post by Ali Sh »

Hello every one
I'm using STM32H743 and VS1003 decoder connected by SPI2
Is there any source code for this version?
CUBMx setting and VS1003 source code


void VS1003_Init(void)
{
// GPIO_InitTypeDef GPIO_InitStructure;


MP3_Reset(0);
delay_ms(1);
MP3_Reset(1);

MP3_DCS(1);
MP3_CCS(1);

//VS1003_SPI_Init();
}
Thanks
Post Reply