Skip to content
Discussion options

You must be logged in to vote

The prescaler serves to divide the clock frequency sourced to the SPI peripheral in order to achieve the desired frequency transmission during the communication.

First, we start finding which is the frequency of the clock signal sourced to the SPI peripheral. From the datasheet of the STM32F401RE (page 14) we can see that SPI peripherals use the clock APB1 or APB2 (depending on the SPI peripheral used). For example, SPI2 uses APB1.

Then, we can go to the STM32CubeIDE and check which frequency is configured for the APB2. We can see that is configured with 42 MHz.

If we want a frequency transmission equal to the example in the other issue (500 kHz), we obtain a prescaler equal to 84. We h…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Albert-Alvarez
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
SPI Serial Peripheral Interface
2 participants
Converted from issue

This discussion was converted from issue #55 on June 26, 2021 17:47.