In this Tutorial im showing how and STM32 Timer ( TIM ) works, and how to use it. My social accounts : / weblearning1 / weblearning1 / weblearning1 Thanks. / weblearning
Пікірлер: 67
@borakavaklioglu42584 жыл бұрын
This is the first tutorial that actually worked for me. You are amazing!
@Weblearning14 жыл бұрын
Yay! Thank you!
@slip0n0fall3 жыл бұрын
Important to note that the Prescaler (and Period) get a '1' added to them (so a setting of 0 means a prescaler of 1, or no scaling)
@ahmedladhibi6893 Жыл бұрын
Simple and clear ! best explaining so far ! thank you ! now a question how do we change the duty cycle and the frequency from the code
@naasikhendricks15015 жыл бұрын
I think a Free RTOS training module will be cool as you explain the essential details well.
@Weblearning15 жыл бұрын
It's also on the To Do list...
@burhanmuhyiddin43725 жыл бұрын
Your tutorials are just perfect. Thank you very much :)
@Weblearning15 жыл бұрын
Thanks for this
@offensivebias3965 Жыл бұрын
Thank you for sharing your knowledge
@englishman_i5 жыл бұрын
Everyone is looking forward to the next video!
@Weblearning15 жыл бұрын
Thanks.
@alexandern86715 жыл бұрын
Good video, thanks. I have not used Cube5 for timers yet but in Cube4 the prescaler and period values equated to the set value +1. I.e. to divide input frequency by 1000, one needed to set the register value to 999. Did Cube5 change this to be more intuitive?
@filipenicoli_5 жыл бұрын
This behaviour is not due to CubeMX, but rather internal implementation details. You can find the Prescaler equation on the Timer Cookbook PDF from ST. There's also an image explaining the reason for the adjustment on auto reload register. Basically, when the timer reaches the "Pulse" value (CCRx), it immediately changes the output, but it waits one timer counting cycle to reset once reaching the auto-reload value (ARR). Thus, you should subtract 1 from ARR and from the Prescaler value, but not from Pulse.
@sudhansumtripathy9 ай бұрын
sir needs some clarification at 2:03 s of video, in 1 sec we get 1000 pulse , do you want to say that the pulse is high for 500 and low for 500, or for 1 complete cycle is 1/1000 =0.001
@trinendragade76404 жыл бұрын
This tutorial helps me a lot Thank you so much brother
@Weblearning14 жыл бұрын
Happy to help
@stm32user4 жыл бұрын
Nice, but how to change the duty cycle ?. shall we increase the 500 while running ?
@Weblearning14 жыл бұрын
Yes. The best way is to play with these parameters and see what happens.
@LoveTheFactory5 жыл бұрын
I wish BlueNRG-2 was STM32 so CubeMX could be used. Is there any way to leverage PWM on STEVAL-BCN002V1's RGB LED(s) ? Maybe with MFT2_TON & TOFF in PWM_config.h that includes BlueNRG1_mft.h in Micro_Hello_World project of DK 1.0.9 ? Or, software ones on PWM2-4_PIN defines ? Thanks for your awesome videos... They are VERY well done and we are very appreciative. :-)
@mohamedfaroukbouklihacene8193 жыл бұрын
hi! thank you for the video! i want a 200khz pwm output and a i have set the internal clock to 8Mhz so i set the prescalar to 40 to have a prescalar output 200khz and when i put 200000 in the ARR(counter period) box it is impossible and the same thing with the CCR(pulse) box please help!
@abdelazeemhassan3701 Жыл бұрын
AMAZING
@ESEben104 жыл бұрын
is there a formula that links the system's clock, presclaer,counter period and the required time in seconds? How should I obtain a period of 0,2s? Thanks for the video.
@Weblearning14 жыл бұрын
Have a look at this: www.emcu.eu/stm32-measure-time-period-and-frequency-of-a-signal-using-the-timer/
@dimitris_g56515 жыл бұрын
Hi can you tell me how what usb osciloscope are you using and how to set it up?
@Weblearning15 жыл бұрын
Have a look at one of my older videos that I do a review on the USB oscilloscope.
@Guty284 жыл бұрын
@@Weblearning1 Cant you just put the link?
@MultiPantero4 жыл бұрын
Hi, probably its very basic stuff, but if I wanna generate a Burst Signal, will be posible using that timer?
@Weblearning14 жыл бұрын
Yes you can. Have a look at examples with STM32 IR, its the same thing.
@TheRainHarvester5 жыл бұрын
How does one edit code using this method? Do you get to save all your menu settings for each timer you setup? (Ex. What if a year from now, I have my code but want to change the pin#/timing etc. But I don't remember the cube Mx stuff I setup that generated the code. ) Just curious. Thanks for the video.
@Weblearning15 жыл бұрын
Well, first it's best to save all you project in one place and the cube IOC file in the same place. if you still can't find the file, the you can read and see all your settings in the main.c file or peripheral files depends how you set it. See the movie that I made on who the cube generate the code.
@luizazeredo51974 жыл бұрын
Traduzindo e entendendo o código, obrigado por compartilhar conhecimento (Brasil)
@НиколайКрасиков-ы8й4 жыл бұрын
Hello, which USB Oscilloscope do you use, please link ali and other? Where can I get such an Oscilloscope/Spectrum link for it?
@Weblearning14 жыл бұрын
I have 2: 1. Rigol 4 ch color scope that i have. I made a video on how to fix it. kzbin.info/www/bejne/kGOxeoyFZsyIgJI 2. A smaller and simpler one that I use for my videos: kzbin.info/www/bejne/qp6pZnVsosmlgrs
@MrRonychakraborty3 жыл бұрын
you should also tell how to change duty
@noithugian4943 жыл бұрын
can you use PWM + timer + DMA to generate DAC at STM32f103c8 ?
@Weblearning13 жыл бұрын
Yes you can. You use a block of data and you set the DMA to push every x time to the PWM. May be you can considerer subscribing to the channel?
@cronnosli4 жыл бұрын
Hi, What I have understood from your example is that you set the frequency in CubeMX. There is a way to change the frequency while running. Let say that I want to modulate several frequencies from 30HZ up to 32MHZ, it is possible?
@Weblearning14 жыл бұрын
Yes. With the STM32 you can change almost everything from the code without resting the device. Just write to the registers again and that's it.
@cronnosli4 жыл бұрын
@@Weblearning1 I'm still a newbie at STM32, there is any howto about writing to registers ?
@poonamjangid015 жыл бұрын
@3.41 in channel 1, no pwm option is available. I am using stm32f103c8t6.
@Weblearning15 жыл бұрын
Try a different channel, it should all work the same way.
@MichasRichter5 жыл бұрын
Will this be applicable to the proposed 7S battery holder PCB with stm32 as BMS?
@Weblearning15 жыл бұрын
Yes, it can. But I didn't get almost anyone that what's to contribute to do this, so it looks like I will drop it for now.
@baslinjames77144 жыл бұрын
In the end of the video, the waveform was displayed and max voltage was around 3..can i increase or decrease that voltage level with the settings in cubemx?
@Weblearning14 жыл бұрын
No, the PWM is only 1 and a 0 of your voltage. You can use a Low pass filter and depending on the frequency, you can make it as a DAC. There are also other ways, with more GPIO and resistors as voltage dividers.
@vladik88433 жыл бұрын
increase and decrease voltage ? Man you need to start learning some basics. First step is to find out what PWM is..
@abdelhakimazzouzi33713 жыл бұрын
Thank you very much!
@Weblearning13 жыл бұрын
You're welcome!
@leezanvlog85484 жыл бұрын
hi, it's very usefull i see you use oscilloscope/spectrum analyzer software, can you give me link to download ?
@Weblearning14 жыл бұрын
I use a low cost one, see my video: kzbin.info/www/bejne/qp6pZnVsosmlgrs
@abutaymiyyahlectures3 жыл бұрын
i want to buy an oscilloscope but its too expensive, i could buy a usb oscilloscope instead, but i dont know which to buy, any recommandations?
@Weblearning13 жыл бұрын
Did you end up buying one? Have a look at the video I made on the USB OSC that I have.
@abutaymiyyahlectures3 жыл бұрын
@@Weblearning1 nope i did not buy but i am still planning to, thank you, yes i will watch it during my holidays which is coming up in less than a week, anyways also, thank you for your videos!
@DarkWolf8873 жыл бұрын
would it be possible to use a function generator insteat of the internal clock? I am connecting a function generator (1000KHz, 3V, 1.5 Offset) to the positive pin of the comparator and in the negative I am using the VRefInt. However I just get a HIGH in the output of the comparator. :(
@Weblearning13 жыл бұрын
What do you want to achieve? Counting pulses? Something else?
@DarkWolf8873 жыл бұрын
@@Weblearning1 yes. But I don’t know what is the best option for this. I’m afraid that connection a 3.3V, 1KHz signal is gonna be a too high frequency to get to trigger at the voltage reference (1.2V).
@tomhyhlik17885 жыл бұрын
thanks
@gikusa20634 жыл бұрын
hello, i try to make pwm in TIM2 as you made but it doesn't work, may i make somethings wrong?
@Weblearning14 жыл бұрын
There are different settings to play with till you get it to work correctly. I cant tell what you made wrong.
@kameleln16173 жыл бұрын
I am beginner in stm32, how you can log PA5 to LD2 and to swtich after that with Tim2_CH1, thank's in advance.
@Weblearning13 жыл бұрын
Sorry, didn't understand your question. Try to elaborate.
@naasikhendricks15015 жыл бұрын
Cool
@aitrile77084 жыл бұрын
thank you
@Weblearning14 жыл бұрын
You're welcome
@srishtisingh16882 жыл бұрын
The following code is showing errors in my PC please help and inform why an error is occurring.
@Weblearning12 жыл бұрын
What type or error?
@Homo_neanderthal2 жыл бұрын
Go study units. You cannot compare sec and hz, they are different units