2019-10-04 01:04 PM
Hello,
I want to get timer frequency between 16MHz to 20MHz. So I picked the TIM4 and set it with internal clock. Based on the datasheet (STM32F767), the timer belongs to APB1 bus. When I set the main clock frequency as 216Mhz, I expect to get 108MHz timer clock. For getting, 16MHz output, I set the prescaler 7-1 and counter period as 1-1. For observing the timer frequency, I enabled one of the pin as GPIO (PC7) and wrote toggling function in a while loop. When I measure from the oscilloscope, I see 1.642MHz signal. Does anyone have an idea how I can get 16MHz signal?
Thank you
2019-10-04 03:06 PM
Need to be willing to run the F7 at 192 MHz, so you can get a workable set of integer dividers.
APB1 @ 96 MHz
>> I set the prescaler 7-1 and counter period as 1-1.
You don't do it that way, you really want the prescaler to be the smaller of the two.
@ 96MHz Prescaler=0, Period=6-1
You can't interrupt at high speeds.
Toggling will half the frequency.
Try 50/50 PWM Duty, Pulse = 3
2019-10-05 01:53 AM
> counter period as 1-1.
JW