This guy is a life saviour! I really appreciate the work you put into your educational videos.
@malgailany5 жыл бұрын
Since this video is about learning. A proper prescaler setting should be (32000-1) and (1000-1). Reason; prescaler =0 will pass the clk without division prescaler =1 divide the clk by 2 prescaler =2 divide the clk by 3 ......... prescaler =(n-1) divide the clk by n Thanks.
@Weblearning15 жыл бұрын
Of course you are correct and thanks for sharing it with everyone.
@Stimmenhotel3 жыл бұрын
@@Weblearning1 Don't know much about video editing on yt. But maybe you can ad this as on-screen note to the video? I have read this elsewhere too. But anyway thanks for your videos!
@Grze98983 жыл бұрын
Great tutorial. I spent hours to figure out why my interrupt is not executed. Watching this video I found TIM was not initialized.Thank you WeB Learning!
@Weblearning13 жыл бұрын
You're welcome!
@nicholasng82912 жыл бұрын
Same here ! was doing HAL_TIM_Base_Start(); end up realizing it should be HAL_TIM_Base_Start_IT(); after watching this video
@ryanfleming24484 жыл бұрын
This example triggered my interrupt only once. I had to also enable the automatic "auto-reload preload" setting as well. Solid tutorial, keep it up!
@Weblearning14 жыл бұрын
Glad it helped
@jelmervd2l4 жыл бұрын
Thank you so much for commenting this, i had the exact same problem!
@sokrates20994 жыл бұрын
I from Turkey. Thanks for your lecture. Socrates bless you.
@Weblearning14 жыл бұрын
Thanks.
@andrelarsen73174 жыл бұрын
Exactly what I was searching for now, Thank you!
@Weblearning14 жыл бұрын
You are welcome!
@ameliabuns40584 жыл бұрын
god I was searching every corner for an interrupt toggle or something! thanks xD but also thanks for making these! BUT I wish you explained every decision and thing too. this'd make it a lot more user friendly. telling people WHAT to do might get them be able to copy what you're doing but EXPLAINING what you're doing is a lot nicer. bascially a case of "give a man a fish bla bla" say for example instead of saying "set clock source to internal" explain each setting and option.
@Weblearning14 жыл бұрын
This is only the basic. There is SO MUCH you can do with the Timer and there are so many other video I want to make ( not enough time ) so I start with the basic and when I will get to it I will show more features.
@arielcarmeli16963 жыл бұрын
Thanks !!!!!!!!!!!!
@abdelaleem40264 жыл бұрын
Great video! Very simple and clear-cut!
@TheKrambambuli5 жыл бұрын
Thanks for making those videos!
@chandruarul79415 жыл бұрын
Nice sir....Thanks for updating
@lonny_breaux Жыл бұрын
thanks a lot of
@GrimReaper-bv4tg4 ай бұрын
How do we know the LED was flashing on your board?👀
@王耀辉-t1r2 жыл бұрын
Very helpful video!!!!! Also, I have a question:why my compiler is arm-none-eabi-gcc and yours is different...
@Weblearning12 жыл бұрын
I used to use Keil. Now I only use CubeIDE.
@talashganvir41446 ай бұрын
Could you please share the function name for the static library?
@Stimmenhotel3 жыл бұрын
Also a more general comment. Since you have done timers already ... A friend of mine told me he was using a timer and the dma capability of a µc to measure the RPM of a motor. Sadly he wasn't able to tell me more about it, since he hasn't used the HAL (or maybe a complete other µc). I understand the idea of DMA, but I don't get behind the ability to measure the RPM with it. I made a code that uses a EXTI to get triggered and check the timer for the counter and potential overflow (had a counter in the overflow-callback). Using this with a normal external button it was quite blocking, since the button introduced much noise since it wasn't debounced. Do you have any idea? Edit: He said the DMA saved something (i believe it was the counter of the timer) and later he used this to calc the mean. I would also ask him for more details ... But he is still sleeping ... Thanks for your videos! Stay save!
@Weblearning13 жыл бұрын
The RPM sends a square wave. The higher the frequency, the higher is the RMP. So you can use the PWM from the RPM feed into the TIM. Then use the DMA to read ever 1sec the counter of the TIM and reset the TIM again. What ever you read, that's is your RPM ( depends on the signal and timing ). Search google for: stm32 measure rpm
@sabzimatic2 жыл бұрын
if interrupt is started again while the current interrupt is going on what will happen in that case? will the code abandon current interrupt and process the new one? or will the new interrupt be put in queue?
@ronaldhofman17265 жыл бұрын
Nice and well explained tutorial, i really like the STm32CUBEMXIDE which i use, can you make a video on the debugging capabilities ?, i just started to learm STM32 and the new cube mx ide is the IDE of my choice because everything is on package., thanx for this video on explaining timer with interupt.
@Weblearning15 жыл бұрын
Thanks for the idea. I will add it to the list...
@quyenoan5463 Жыл бұрын
Hi sir, could you please suggest me how to use interrupt to reset value of encoder with user button when rotate it back to the starting point. Thank you so much
@yashkanani485810 ай бұрын
why prescaler is set to 32000? should it n't be 32-1?
@PauloSantos-cv1bi5 жыл бұрын
Great videos! thank you!
@Weblearning15 жыл бұрын
Thanks.
@nickm25175 жыл бұрын
Awesome tutorial. How does using a timer for an interrupt differ from using a GPIO interrupt? Thanks!
@Weblearning15 жыл бұрын
GPIO is a physical interaction with your system, so something will happen only if you press a button. A timer will make an interrupt (or an event ) every time the counter will runout of the set value you have programmed.
@nickm25175 жыл бұрын
@@Weblearning1 Thanks, very helpful!
@yassin55684 жыл бұрын
Hello, thank you for you effort can you please tell me, how can i change timer period while running application STM32F4 ? thank you
@Weblearning14 жыл бұрын
Just change the registers while ruining your code.
@erenturk72943 жыл бұрын
How did you adjust the time to toggle
@Weblearning13 жыл бұрын
I had explained this in: kzbin.info/www/bejne/j4GtnZuPopqHbrs
@williamtaisonsarassa47615 жыл бұрын
Please, I would like to see classes on ADC, ADC + DMA
@Weblearning15 жыл бұрын
There is one on ADC, did you see it? I still have more videos to do, it takes time...
@williamtaisonsarassa47615 жыл бұрын
I did not find the video
@Weblearning15 жыл бұрын
It's not market clearly, but you will find it here: kzbin.info/www/bejne/i6vZeoubh6iNrZI
@bensvetlov72742 жыл бұрын
Has anyone ran into an issue where their timer clock frequency does not change, no matter what you change the APB bus to (using CubeMX clock configuration)? I am using a STM32H745I-DISCO board and have made sure I have included all aspects of every video I have watched on timer interrupts. Everything is working properly but no matter how I change the clock configuration, it is still the same (the values change but the LED still blinks way too fast: 240MHz even if I have the APB bus at 64MHz). Thanks in advance, I have spent a few days on and off trying to figure it out
@erenturk72943 жыл бұрын
Why dont u use mbed studio
@Weblearning13 жыл бұрын
Mbed is a way to right code in high level just like Arduino IDE that you can also use the STM32. But, you cannot debug it and the coder is much bigger. I do use sometimes MBED or Arduino, it all depends on what I want to do and how fast I want to do it. NEVER for a product. May be you can considerer subscribing to the channel?
@m.dasvirgenss5 жыл бұрын
why don't put interrupt routine on IRQHandler directly instead to "create" HAL_TIM_PeriodElapsedCallback's function??
@Weblearning14 жыл бұрын
I need to start explaining things slowly. There are so many things that can be done, so I take it one step at a time.
@DB--lv6tt4 жыл бұрын
Thanks, helped so much. But I got a question to the interrupt handler: void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) dose not contain die Timernumber! How can I implement different interruptroutiens for ex. Timer 2 und Timer 6?? Greetings from Germany, A.
@Weblearning14 жыл бұрын
Its hard to tell without know more. Look in google for HAL_TIM_PeriodElapsedCallback, there are many answers on the ST community.
@DB--lv6tt4 жыл бұрын
No, not hard. I've found what I was missing: void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) { if(htim->Instance == TIM3){ // Do ISR for timer 3 } if(htim->Instance == TIM6){ // Do ISR for timer 6 } } The ISR in your video will be called by overflow from every timer. Thanx for answering, greetings, A
@subramaniantr20914 жыл бұрын
This will work but then the beginners will not know anything even after implementing. I suggest you use HAL functions and not cube MX. At least the function calls can be explained better and which register is set etc can be explained.
@Weblearning14 жыл бұрын
You are right, but some want to get it going with min. reading and searching and the CubeMX is the best way to do that.
@subramaniantr20914 жыл бұрын
@@Weblearning1 I agree. But if you could do one with the default HAL, that comes when you create a project with openSTM bench, I somehow feel is the best way to satisfy both the groups. Because I see that these CUBE HALs are quite unreadable linking to functions after functions. The default HALs directly show what registers they're programming at the same time they provide the same exact functions that we want to implement using structures. I have had my own share of tough times with no knowledge about how to go about learning. Not that I've mastered anything. But this is a time where I have learnt how to learn before which I was searching in darkness. A designer who does not know or re inventing the HALs by reading it will always be handicapped and CUBE MX supports this. It's like teaching the student 1155665 instead of do-do-sol-sol-la-la-sol in piano.He will play twinkle twinkle, but not know it. Sorry for the long comment. I just wanted to request you in short to put up tutorials with default HAL in case you have time.
@Weblearning14 жыл бұрын
Thanks for this. It's hard to make everyone happy when making such videos. Most of the viewers need this basic approach. You just need to look at how many are using Arduino language. Coming back to how you are doing things, I suggest that you will have a look at LL lib that is also part of the CubeMX. You will see that it's much more closer and simple to what you want. When I will finish with the HAL ( one day ) I might start with LL examples.
@fabiorodriguez82584 жыл бұрын
how can i change the period y need a variable period , please help
@Weblearning14 жыл бұрын
See again the video min. 0:40 where I explain how the calculation is done.
@faiezfatnassi8184 жыл бұрын
So in this example the LED blnks every 2 seconds right? koz after 1 second toggle will set it to on then after next second it sets it to off? Or i understand the whole thing wrong ?
@Weblearning14 жыл бұрын
The trigger is how you call it. So, blink every 1 sec ( i.e. 1Hz ), will cause the LED to change state every 1 sec.
@luizazeredo51974 жыл бұрын
Como se faz um calculo para a interrupção acontecer a 100uS ? Gostei do seu metodo de demostração de aula .
@Weblearning14 жыл бұрын
Please view the comments on the video below.
@ardaklc76174 жыл бұрын
Thanks
@Weblearning14 жыл бұрын
Welcome
@joeyDrivez2 жыл бұрын
So how can I add a pushbutton so that once pressed and released the led toggles? how can I achieve that??
@Weblearning12 жыл бұрын
You can use this video, and turn on the LED when you press the button: kzbin.info/www/bejne/i6XOpK2ZoMqWjJo
@joeyDrivez2 жыл бұрын
@@Weblearning1 I meant using a timer as well, so that once the button is released the LED flashes on and off using timers.
@Weblearning12 жыл бұрын
In the interrupt of the button, you start the timer.
@sabzimatic2 жыл бұрын
Please share link to your timer video that you mention at this instance.. kzbin.info/www/bejne/j4GtnZuPopqHbrs thank you