2020-05-18 01:13 PM
When using HSI RC, everything works fine. After switching to HSE, Pinout&Configuration tab in STM32CubeIDE calculates a wrong TQ, as far as I can see. I use 250 kHz Bus, so 4 MHz clock results in TQ 250 ns. 16 TQ is 250 kHz.
For example, for PLLMult 4
I get, for prescaler 2 62.5 ns, although the value should be 250 ns:
I think that cannot be right, as my scope shows that frequency is 250 kHz:
and the device works fine in 250 kHz bus. Therefore, the prescaler divides external 8 MHz frequency by 2 and 4 MHz is 250 ns. If I choose any other prescaler, I get a wrong frequency.
The way to do it is to generate code with setup in the first 2 pictures and then change
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL4;
into
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL6;
in the generated code.
If I try to choose multiplier 6, the IDE refuses to generate code as it calculates a wrong TQ.
Am I doing something wrong?
2020-08-31 03:55 AM
The problem was in external clock was 6 times slower than I thought. So, it was my mistake. I must nevertheless note that from some other manufacturers I got very helpful answers within 24 hours, that help me solve the problem. Here, 3 months and nothing.