Skip to main content
Explorer
March 1, 2024
Solved

SCKL frequency of SPI

  • March 1, 2024
  • 3 replies
  • 3551 views

Hello,

I have set the BR bit in CR1 to 0 with the expectation of obtaining an 8MHz clock frequency. However, I am encountering an actual frequency of approximately 1.042MHz. Does anyone have an explanation for this issue, or should I consider implementing any calibration procedure for the clock?

 

Best regards,

    This topic has been closed for replies.
    Best answer by TDK

    Default clock (MSI) frequency is 2.097 MHz. Half that is about 1.042 MHz. That is what you're seeing.

    Unclear what the current state of this issue is. If you're trying to disable MSI, you will need to switch the system clock to HSI first. Not just turn HSI on, but actually switch the system clock to use it.

    3 replies

    Technical Moderator
    March 1, 2024

    Hello @YoussefElbattah and welcome to the ST Community :smiling_face_with_smiling_eyes:.

    Can you add more details about your use case (The MCU that you are using, the clock source of your SPI,...).

    Best Regards.

    STTwo-32 

    Explorer
    March 1, 2024

    Hello,

    Thank you, i'm using STM32L152RE and my clock source of SPI is HSI 16Mhz so if i divide by 2 i will get 8Mhz not 1Mhz.

    Best Regards.

    Youssef

    Technical Moderator
    March 1, 2024

    What are the values of the APB1 Prescaler, APB2 Prescaler and AHB Prescaler on the clock tree.

    Best 

    Regards

    STTwo-32 

    TDKAnswer
    Super User
    March 3, 2024

    Default clock (MSI) frequency is 2.097 MHz. Half that is about 1.042 MHz. That is what you're seeing.

    Unclear what the current state of this issue is. If you're trying to disable MSI, you will need to switch the system clock to HSI first. Not just turn HSI on, but actually switch the system clock to use it.

    Explorer
    March 8, 2024

    Thank you i have fixed the issue :grinning_face: