Тёмный
No video :(

HAL #8: HowTo - Timer PWM 

Web learning
Подписаться 10 тыс.
Просмотров 67 тыс.
50% 1

In this Tutorial im showing how and STM32 Timer ( TIM ) works, and how to use it.
My social accounts :
/ weblearning1
/ weblearning1
/ weblearning1
Thanks.
/ weblearning

Опубликовано:

 

27 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 67   
@borakavaklioglu4258
@borakavaklioglu4258 4 года назад
This is the first tutorial that actually worked for me. You are amazing!
@Weblearning1
@Weblearning1 4 года назад
Yay! Thank you!
@slip0n0fall
@slip0n0fall 3 года назад
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
@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
@burhanmuhyiddin4372
@burhanmuhyiddin4372 5 лет назад
Your tutorials are just perfect. Thank you very much :)
@Weblearning1
@Weblearning1 5 лет назад
Thanks for this
@naasikhendricks1501
@naasikhendricks1501 5 лет назад
I think a Free RTOS training module will be cool as you explain the essential details well.
@Weblearning1
@Weblearning1 5 лет назад
It's also on the To Do list...
@offensivebias3965
@offensivebias3965 10 месяцев назад
Thank you for sharing your knowledge
@trinendragade7640
@trinendragade7640 4 года назад
This tutorial helps me a lot Thank you so much brother
@Weblearning1
@Weblearning1 4 года назад
Happy to help
@abdelazeemhassan3701
@abdelazeemhassan3701 Год назад
AMAZING
@sudhansumtripathy
@sudhansumtripathy 8 месяцев назад
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
@englishman_i
@englishman_i 5 лет назад
Everyone is looking forward to the next video!
@Weblearning1
@Weblearning1 5 лет назад
Thanks.
@alexandern8671
@alexandern8671 5 лет назад
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_
@filipenicoli_ 4 года назад
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.
@luizazeredo5197
@luizazeredo5197 4 года назад
Traduzindo e entendendo o código, obrigado por compartilhar conhecimento (Brasil)
@stm32user
@stm32user 4 года назад
Nice, but how to change the duty cycle ?. shall we increase the 500 while running ?
@Weblearning1
@Weblearning1 4 года назад
Yes. The best way is to play with these parameters and see what happens.
@mohamedfaroukbouklihacene819
@mohamedfaroukbouklihacene819 3 года назад
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!
@MrRonychakraborty
@MrRonychakraborty 3 года назад
you should also tell how to change duty
@dimitris_g5651
@dimitris_g5651 4 года назад
Hi can you tell me how what usb osciloscope are you using and how to set it up?
@Weblearning1
@Weblearning1 4 года назад
Have a look at one of my older videos that I do a review on the USB oscilloscope.
@Guty28
@Guty28 4 года назад
@@Weblearning1 Cant you just put the link?
@MultiPantero
@MultiPantero 3 года назад
Hi, probably its very basic stuff, but if I wanna generate a Burst Signal, will be posible using that timer?
@Weblearning1
@Weblearning1 3 года назад
Yes you can. Have a look at examples with STM32 IR, its the same thing.
@ESEben10
@ESEben10 4 года назад
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.
@Weblearning1
@Weblearning1 4 года назад
Have a look at this: www.emcu.eu/stm32-measure-time-period-and-frequency-of-a-signal-using-the-timer/
@poonamjangid01
@poonamjangid01 5 лет назад
@3.41 in channel 1, no pwm option is available. I am using stm32f103c8t6.
@Weblearning1
@Weblearning1 5 лет назад
Try a different channel, it should all work the same way.
@user-px4tj9cp9u
@user-px4tj9cp9u 4 года назад
Hello, which USB Oscilloscope do you use, please link ali and other? Where can I get such an Oscilloscope/Spectrum link for it?
@Weblearning1
@Weblearning1 4 года назад
I have 2: 1. Rigol 4 ch color scope that i have. I made a video on how to fix it. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-Z2NIYO1gUJ0.html 2. A smaller and simpler one that I use for my videos: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-tmF5B6mdrLY.html
@abdelhakimazzouzi3371
@abdelhakimazzouzi3371 3 года назад
Thank you very much!
@Weblearning1
@Weblearning1 3 года назад
You're welcome!
@noithugian494
@noithugian494 3 года назад
can you use PWM + timer + DMA to generate DAC at STM32f103c8 ?
@Weblearning1
@Weblearning1 3 года назад
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?
@MichasRichter
@MichasRichter 5 лет назад
Will this be applicable to the proposed 7S battery holder PCB with stm32 as BMS?
@Weblearning1
@Weblearning1 5 лет назад
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.
@LoveTheFactory
@LoveTheFactory 5 лет назад
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. :-)
@baslinjames7714
@baslinjames7714 4 года назад
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?
@Weblearning1
@Weblearning1 4 года назад
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.
@vladik8843
@vladik8843 3 года назад
increase and decrease voltage ? Man you need to start learning some basics. First step is to find out what PWM is..
@TheRainHarvester
@TheRainHarvester 5 лет назад
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.
@Weblearning1
@Weblearning1 5 лет назад
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.
@tomhyhlik1788
@tomhyhlik1788 5 лет назад
thanks
@abutaymiyyahlectures
@abutaymiyyahlectures 3 года назад
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?
@Weblearning1
@Weblearning1 3 года назад
Did you end up buying one? Have a look at the video I made on the USB OSC that I have.
@abutaymiyyahlectures
@abutaymiyyahlectures 3 года назад
@@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!
@DarkWolf887
@DarkWolf887 3 года назад
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. :(
@Weblearning1
@Weblearning1 3 года назад
What do you want to achieve? Counting pulses? Something else?
@DarkWolf887
@DarkWolf887 3 года назад
@@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).
@cronnosli
@cronnosli 4 года назад
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?
@Weblearning1
@Weblearning1 4 года назад
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.
@cronnosli
@cronnosli 4 года назад
@@Weblearning1 I'm still a newbie at STM32, there is any howto about writing to registers ?
@srishtisingh1688
@srishtisingh1688 2 года назад
The following code is showing errors in my PC please help and inform why an error is occurring.
@Weblearning1
@Weblearning1 2 года назад
What type or error?
@gikusa2063
@gikusa2063 4 года назад
hello, i try to make pwm in TIM2 as you made but it doesn't work, may i make somethings wrong?
@Weblearning1
@Weblearning1 4 года назад
There are different settings to play with till you get it to work correctly. I cant tell what you made wrong.
@leezanvlog8548
@leezanvlog8548 4 года назад
hi, it's very usefull i see you use oscilloscope/spectrum analyzer software, can you give me link to download ?
@Weblearning1
@Weblearning1 4 года назад
I use a low cost one, see my video: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-tmF5B6mdrLY.html
@Homo_neanderthal
@Homo_neanderthal 2 года назад
Go study units. You cannot compare sec and hz, they are different units
@naasikhendricks1501
@naasikhendricks1501 5 лет назад
Cool
@aitrile7708
@aitrile7708 4 года назад
thank you
@Weblearning1
@Weblearning1 4 года назад
You're welcome
@kameleln1617
@kameleln1617 3 года назад
I am beginner in stm32, how you can log PA5 to LD2 and to swtich after that with Tim2_CH1, thank's in advance.
@Weblearning1
@Weblearning1 3 года назад
Sorry, didn't understand your question. Try to elaborate.
Далее
HAL #9: HowTo Low power  STOP
4:58
Просмотров 7 тыс.
STM32 Guide #3: PWM + Timers
20:24
Просмотров 140 тыс.
ПРАВО НА ЖИЗНЬ НУЖНО ВЫИГРАТЬ
32:38
Cute kitty gadgets 💛
00:24
Просмотров 16 млн
Woman = best friend🤣
00:31
Просмотров 2,1 млн
Lecture 13: Timer PWM Output
16:47
Просмотров 105 тыс.
HAL #10: HowTo Timer with Interrupt
5:18
Просмотров 49 тыс.
STM32 PWM basics
18:31
Просмотров 20 тыс.
STM32F4 Bare Metal Programming - Timers:  Output Compare
51:41
TL494 PWM 50HZ to 100Khz | TL494 PWM Schematic
9:27
Просмотров 44 тыс.
STM32 TIMERS #4. INPUT CAPTURE  || Frequency and Width
13:57
STM32 Guide #4: Generated Code, HAL, and Bare Metal
26:20
HAL: #1 How to - GPIO
5:32
Просмотров 41 тыс.
Lecture 9: Interrupts
20:43
Просмотров 264 тыс.