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!
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.