STM32 TIMERS #4. INPUT CAPTURE || Frequency and Width

preview_player
Показать описание
________________________________________________________________________________________

________________________________________________________________________________________

******* SUPPORT US BY DONATING******

*******Join the Membership*******

Рекомендации по теме
Комментарии
Автор

Appreciate your effort for providing such high quality tutorials for free

Engrbilal
Автор

Thanks for a great video, I added an overflow IRQ to sample very slow frequencies on the same counter. Also I added a flag once a conversion is ready to calculate and stopped the edge IRQ, so this lets you push the measurement range a bit high if you are looking at constant frequencies.

PaulSanders-no
Автор

This guy is smarter than my professor!

bobby
Автор

I am using the stm32h745-nucleo board. Currently I am Working with the timers.

As I am working with the timers I need one timer in the cm4 and another timer in the cm7. I need to capture the falling edge of timer cm7 and need to give input for cm4 timer.

Could you please help me out to find the falling edge for cm7 timer pulse to achieve this.

sarathm
Автор

Hello friend! I wanted to ask you a question. You know that IC (Input Capture) function that we use in timers? I generally saw that it is used to read frequency, I have already tested it for this purpose too and it works well. But one thing that I was never able to do using the IC in that mode that activates the interrupt by rising and falling edges, was to have information whether the interrupt was activated by a rising edge or a falling edge. And a while ago I searched everywhere, I did a lot of tests, apparently a flag was supposed to be set according to the edge that activated it, but it was never set. In fact, I tested this a lot and ended up thinking that it is impossible, which for me is absurd, considering that the information is there, but it seems inaccessible. Having said that, please, is it possible to use the IC with interruption on both edges (rising and falling) and be able to identify the edge? For example, if it was a rising edge, I want to enter an if, if it was a falling edge, I want to enter another if (or else). I really wanted it to be possible, thinking about an application to check synchrony between square waves and the difference in angle between them. If it's not possible, then I'll do it with a timer and perhaps external interruption, but I wanted to use the IC for precision. I would be very grateful if you could clarify whether it is possible or not. Thanks!

roy_hawk
Автор

Thank you for the video! But I have a question: is timer 1 and timer 2 physically connected? How can timer2 receive the pwm input from timer1? and why would HAL_TIM_IC_CaptureCallback trigged by timer1? I thought AL_TIM_IC_CaptureCallback is triggered by input, but timer1 is output. Thank you very much again!

LinusLee-pguu
Автор

Thank you so much. I have a question, how can I confirm that the first incoming interrupt is triggered by a rising edge and the second interrupt is generated by a falling edge? From what I see here, the entire period is 100 clocks, and the pulse width is 30. Most of the time, I get a difference result of 70, but sometimes after a while it becomes 30. It looks like the first interrupt is generated by a falling edge, while the second interrupt is generated by a rising edge.

UTubeJamesChou
Автор

Thanks for the really informative and clear set of STM32 timer tutorials. However, I just cannot get this IC set up working. I'm using a Blue Pill board in the STM32CubeIDE and the debugger message "(Suspended : Signal ; SIGTRAP/Trace/breakpoint trap)" is displayed. The PWM is being generated and there are no breakpoints set. Can you help?

MrItsfitz
Автор

Plaese do a video on i2c with dma..trying this with mpu6050 and no succes at the moment

martinchristiansson
Автор

At the 1m45s mark that shows the block diagram.. where does it say that Timer1 PWM Output can be used as the input to Timer2 Input-Capture?

For example, in the RM it says the input signal to measure (IC4) via Input-Capture reg is selected (ICSELECTION) in TIM2_CCMR2 as : TI4 (b01-Direct), TI3 (b10-Other Channel3), or TRC(b11)

Where does it say that TI4 is not the input pin, but rather Timer 1's Output PWM?

bennguyen
Автор

If I’m taking input from an external wave generator do I just connect it to one of the timers

afiziadebisi
Автор

I want to measure the rpm of an engine. Using the information in this video, can the rpm of an engine be measured with the help of a sensor(like fc-33)? If it can be measured, how should I proceed?

yasinbyker
Автор

hi, nice videos, could you make a tutorial about dmx timing via uart for stm32 ?

labamichnetvoll
Автор

Thank you so much for the help. I understood a lot of things and configurations that i didn't in class. However im having trouble with the measurement of frequency, i do have the pins A0 and A8 connected but the live expression frequency stays at cero.

ulisesferreira
Автор

What if falling edge will appear first, then you will measure width between falling and rising, so 80% ?

mmt
Автор

Hi. How i can measure the frequency of sine wave ?

ramzibrik
Автор

can we get any frequency value if we dont give any input signal to the microcontroller?

najidjalees
Автор

My board is STM32 Discovery board so in that case what settings I should do to get output . I have done all settings according to your video but still I am not getting the output frequency.Kindly tell me the hardware settings also

YogeshJagtap-fz
Автор

does this code work if i wanted to count the number of pulses of a high speed rolling theeth gear? (every tooth gives a pulse)

medraouf
Автор

Hello
If i need to use timer input capture for capturing both rising and falling of a tounch sensor
And i need to check whether the difference is equal or greater than 5sec if so i need to execute respective tasks how can i do that for 16 bit timer
I configured for 1ms configuration
It will be long pulse where several counter roll out would happen how to do this basically how can we have condition to check for whether greater than 5sec at the moment i release

Shet_does