Hi, were no problems with this before. About project: 407 with 10 UART`s.
I have tried many configurations calculated in Cube, but every time some problems occur.
1.Delay <ms> component working correct.
2.Timer interrupt works 10 times faster, then calculated value. How setting controlled interrupts?
3.Now i try configuration on picture — peripheral devices confidently receive only 1200bps (UART timings wrong? I allways use software UART`s). How setting controlled UARTS? Preferals are works normal, can communicate with high speed, tested with PC/CH340.
4.With HCLK 168MHz preferal UART`s do nothing (pull-up voltage without any data).
Now, what i want:
1.Choose real settings with current project — important! Strategy is incerasinc core frequency as possible. Quartz is 8M.
2.Get a deep understanding of this.
STM32F407ZG — How to set frequencies correctly?
-
TheShadowOfTriumph
- Posts: 23
- http://meble-kuchenne.info.pl
- Joined: Wed Feb 08, 2023 3:33 pm
-
LeighM
- Valued Contributor
- Posts: 535
- Joined: Mon Dec 07, 2020 1:00 pm
- Has thanked: 94 times
- Been thanked: 289 times
Re: STM32F407ZG — How to set frequencies correctly?
To use 8MHz crystal and maximum allowed clock rates here are suggested settings
The Flowcode Timer interrupt dialog calculations are incorrect for STM devices (Flowcode does not know about multiple clocks)
Therefore you need to work out yourself the prescaler and roll over values.
For any particular timer you will need to check the ST datasheet to see which APB clock it uses (or set APB1 and APB2 to the same frequency)
Also note that some STM32F407 timers are 32 bit and the Flowcode timer interrupt dialog does not accept 32 bit values (as far as I know), so for long timer durations (or slow UART baud rates) you might need to lower the APB clock frequency.
The Flowcode Timer interrupt dialog calculations are incorrect for STM devices (Flowcode does not know about multiple clocks)
Therefore you need to work out yourself the prescaler and roll over values.
For any particular timer you will need to check the ST datasheet to see which APB clock it uses (or set APB1 and APB2 to the same frequency)
Also note that some STM32F407 timers are 32 bit and the Flowcode timer interrupt dialog does not accept 32 bit values (as far as I know), so for long timer durations (or slow UART baud rates) you might need to lower the APB clock frequency.