2019-07-19 02:11 PM
Hello!
I have problem with spi4 clock speed. I want to drive a lcd tft display but spi clock is max 500Khz, baudrate prescaler set to SPI_BAUDRATEPRESCALER_2. Is very weird. Initial setup was made with CubeMX to 48Mbit/s. APB2 clock is set to 96Mhz. I tried with dma, and without hal but the speed remains the same
What is the cause of this very low spi clock output speed?
Solved! Go to Solution.
2019-07-20 02:55 AM
Read out and check/post the relevant RCC register's content.
Do you use any bootloader?
JW
2019-07-20 03:27 AM
2019-07-20 03:31 AM
2019-07-20 04:20 AM
You can even make spi by gpio at such speed to test the display functionality, then tune with spi hw peripherals
2019-07-20 05:24 AM
As you can see, although PLL is switched on in CR, PLLCFGR is at its default value; nonetheless your system clock is set to HSI in CFGR, and both APB dividers are set to 16 (maximum).
In other words, you don't run the SystemClock_Config() function as you've presented us above. Find out, how do you actually set the clocks.
JW
2019-07-20 05:43 AM
Something nominal in SystemInit() would be my guess
2019-07-20 05:56 AM
Yes, you are right! I will try to setup the clock somehow.
Thank you!
2019-07-20 10:22 AM
Yess! done:) thank you for all. Clive, i set up in the SystemInit() the RCC_CFGR and RCC_PLLCFGR without calling the SystemClock_Config() and now spi is fast as hell:D
2019-07-20 03:20 PM
The only mistake was that when i created the code with CubeMX in the RCC setup the HSE selected value was BYPASS Clock Source and not Chrystal/Ceramic Resonator