i have a question.when i work with spi at stm32f4.when config Baudrates.it shows 76KBits/s. Is that the Bit rate.And with my clock is 10MHZ .how can i calculate my Baudrates.(Frame fomat: Motorola. Data size: 8 bits.).Thanksyou!
closed as unclear what you're asking by Bence Kaulics, pipe, Leon Heller, PeterJ, Dmitry Grigoryev Sep 26 '16 at 10:33
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
SPI doesn't use start or stop bits, so there is no 'wasted' signal time.
There are only two symbols (high and low), so Baud rate = bit rate, measured in bit/s, kbit/s, Mbit/s, etc (not KBits/s).
If the SPI clock is 10MHz, then the bit rate will be 10Mbit/s divided by 2, 4, 8, 16, 32, 64, 128, 256, set by the 'Baud rate control' bits in e.g. 'SPI control register 1'
The nearest divider of 10MHz clock, to approach 76kbit/s is 128.
Some STM32F4xxx SPI are programmable for 8 or 16 bit units of transfer, so you can choose 8 bits/transfer if that's what you want.
The SPI slave does not need to be configured for the transfer speed because the master provides a clock signal (SCLK) which keeps the slave synchronised explicitly. The master's SPI clock is active when data is being transferred, and that clock signal drives the slave's sensing data in signal (MOSI), or setting the data output signal (MISO).
So, as long as the SPI slave can keep up with the transfer speed, the actual transfer speed can vary significantly, and the clock signal keeps the SPI slave synchronised.
This is unlike asynchronous transfers, where both sides of the transfer need to know the transfer speed because they need to use that to recognise and extract the data.