![]() ![]() * Invalid timer selected for PWM input capture If you need to set another value, then use define in defines.h file: Expected frequency is just some kind of reference, how to set timer with prescaler, so you will be able to measure entire PWM period with one timer’s period value for valid result!ĭefault NVIC priority for all timers is set to 0x01.I suggest you to use 32-bit timer (TIM2, TIM5) to measure input PWM, you got better result and better accuracy.Example: if you expect signal of 1000Hz, then set value to 950 in initialization function or something like that.I suggest you that you set this value to 1 if you don’t know what you can expect, if you know, then set it to a little bit smaller value. This can be very low value, but if you have then signal in 10kHz spectrum, your result can veery very fail from real.TIM_CLOCK / (TIM_MAXPRESCALER * MAXTIM_PERIOD).If you want to go even lower, you can basically go to a value of If you don’t know which frequency you can expect on your input, then set initialization function to 1, which means that you want to measure minimal frequency of 1Hz.Only 1 channel can be selected on 1 timer.TIM10, TIM11, TIM13 and TIM14 have only one PWM channel.TIM6 and TIM7 don’t have PWM feature, they are only basic timers.Not all timers works with same tick frequency.Not all timers are available on all STM32F4xx devices.PPx: Pins Pack 1 to 3, for 3 possible channel outputs on timer. ![]() You can select any of max 3 pins for each input channel. Table below shows all possible pins for each timer and channel.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |