cancel
Showing results for 
Search instead for 
Did you mean: 

peripheral clock speeds on STM32f207

epataky
Associate II
Posted on May 21, 2014 at 21:43

i am using STM32f207

i have a flash memory connected to SPI2.  I used the ST examples and i got it working, read/write, .. great, ... the problem is the speed ... how fast can i run SPI2?  

There is a setting SPI_InitStruct.SPI_BaudRatePrescaler and the lowest value is SPI_BaudRatePrescaler_2

In my SetSysClock function i set the dividers to 1:  http://prntscr.com/3lbcy6

This should give me the fastest speed?

My flash goes up to 85MHz and i need to go at least 80MHz because there is a lot of data to read in short time .. will this be possible on SPI2?  I have a 25MHz xtal on the board and i am running the ST at 120MHz via PLL.  
9 REPLIES 9
epataky
Associate II
Posted on May 21, 2014 at 21:49

maybe if i want to go that fast i need use I/O?

Posted on May 21, 2014 at 21:55

In my SetSysClock function i set the dividers to 1:  This should give me the fastest speed?

Wouldn't it just break the buses? APB1 has a max of 30 MHz, APB2 60 MHz

For faster flash interfacing consider SDIO
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
epataky
Associate II
Posted on May 21, 2014 at 22:24

i see .. i saw that in the ref manual but i did not want to believe it .. ok i will use i/o then .. thank you

epataky
Associate II
Posted on May 21, 2014 at 22:27

can i connect SPI2 to AHB2?

epataky
Associate II
Posted on May 21, 2014 at 22:32

about breaking the busses, HCLK is the xtal freq right? so 25mhz will not break ahb1 if i set the ahb1 divider to 1?

Posted on May 21, 2014 at 23:11

can i connect SPI2 to AHB2?

I'm not sure how you plan on achieving that without reworking the silicon.

 

about breaking the busses, HCLK is the xtal freq right? so 25mhz will not break ahb1 if i set the ahb1 divider to 1?

No, it's the CPU (PLL) clock at 120 MHz, or a fraction thereof (1 .. 512). Review the clock tree

You could bit bang the part, as you suggest, there are other 4-bit (quad) SPI Flash devices too

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on May 21, 2014 at 23:17

0690X00000602rRQAQ.jpg
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
John F.
Senior
Posted on May 22, 2014 at 09:04

From the DataSheet ...

''The STM32F20x devices feature up to three SPIs in slave and master modes in full-duplex

and simplex communication modes. SPI1 can communicate at up to 30 Mbits/s, while SPI2

and SPI3 can communicate at up to 15 Mbit/s.''

Thus, even using all three channels simultaneously, the SPI hardware does not support the required throughput.

epataky
Associate II
Posted on May 28, 2014 at 02:15

Thank you i setup the clocks correctly now .. switched to SPI1 and all is good now thank you