2024-03-01 01:33 PM
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,
Solved! Go to Solution.
2024-03-03 05:07 AM
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.
2024-03-01 01:46 PM
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
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-03-01 02:18 PM
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
2024-03-01 02:44 PM - edited 2024-03-01 02:45 PM
What are the values of the APB1 Prescaler, APB2 Prescaler and AHB Prescaler on the clock tree.
Best
Regards
STTwo-32
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-03-02 01:28 AM - edited 2024-03-02 01:32 AM
I've discovered that the system clock used is MSI which has low frequency when attempting to set the HSION and reset MSION in the CR register of the RCC peripheral, I encountered an issue. While HSION is successfully set, the MSION doesn't reset. because in the datasheet it tels me that the MSION cannot reset if it is used a default system clock.
For the value of APB2, APB1 and AHB prescalers are 0.
By the way i'm not using Cubemx and HAL APIs.
Best Regards
2024-03-03 05:07 AM
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.
2024-03-08 01:46 PM
Thank you i have fixed the issue :grinning_face: