cancel
Showing results for 
Search instead for 
Did you mean: 

How to control SPI clock..

saimaddy123
Associate II
Posted on March 23, 2011 at 15:46

How to control SPI clock..

3 REPLIES 3
Posted on May 17, 2011 at 14:29

Change the prescaler, change the APB clock, or become a ''slave'', and pull the clock from a timer or USART baud clock.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
saimaddy123
Associate II
Posted on May 17, 2011 at 14:29

Thanks for the reply..  I tried to change PreScaler to various values..but i did not notice any change in the clock.. I searched in ST documentation for PreScaler content, but i could not find it...

As of now, my SPI clock is running at 10MHZ which is very fast..Can any one throw some light on how to configure the clock to very small value like 100kHz?

Thanks,

Sai

Posted on May 17, 2011 at 14:29

You really need to review the reference manual, or look at the FW library, if you don't believe me.

You may divide the APB by 2,4,8,16,32,64,128 or 256. At 36 MHz the minimum would be 140.625 KHz, want it slower, drop the APB lower.

You can use an external source if you are the ''slave''.

You may also bit-bang the port at a rate of your choosing, given the odd behaviour I've experienced with the SPI port this might be a preferred solution.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..