At last. A tutorial I could follow and have a timer driving an output. Thanks.
@pranjal3727
3 жыл бұрын
Love it. Thanks. It's just small kick-start which let me shed the fear of non-arduino micros.
@RiffRaff109
3 жыл бұрын
No info on how to change PWM duty cycle, No info on how to read current timer value or reset it. Would have been nice if you also showed how to use no output PWM inside the program.
@stmicroelectronics
3 жыл бұрын
Hi there, for technical questions we really recommend you check out our community of experts and other developers at community.st.com
@gabrielvigiano
3 жыл бұрын
HAHAHA thats it...
@klausrolland4121
3 жыл бұрын
You are right, it would be really helpful to see how to change the duty cycle programically after the initial setup
@klausrolland4121
3 жыл бұрын
There is a macro for that: __HAL_TIM_SET_COMPARE(&htim1, TIM_CHANNEL_1, pulse_width);
@MicaCZ
3 жыл бұрын
Really helpful and straight forward. Thank you!
@stmicroelectronics
3 жыл бұрын
Glad to hear !
@elais5785
2 жыл бұрын
Thanks a lot!! This was very useful for a school project!
@otabektillavayev3309
Жыл бұрын
Thanks of millions
@kenwallace6493
3 жыл бұрын
I have always thought that HAL was a needless extra layer of abstraction that removes one further from bare metal where the reference manual and spec are king. This is especially true for embedded power conversion applications where one is always 1uS from disaster. These videos are starting to change my mind. I still wonder how HAL would handle a complex high-resolution timer job with, say phase-shift bridge PWM with synchronous rectifier drive.
@mimimmimmimim
2 жыл бұрын
AFAIK, and I've been using the Cube HAL for like 5 or 6 years I think, still the MCU handles things. We're not dealing with registers directly now. Except for my beloved DWT->CYCCNT :) I never believed an extra layer or two would effect performance, since we're still using C and hardware and compiler optimizations occur without letting us interfere anyway (actually I stay away from compiler optimizations whenever I can). It's in the name, just the abstraction layer. Though, if I was absolutely true, ST would not spend time to represent Low-Layer (LL) stuff... Probably you're right. Especially depending on the target application. Guess I know not as much as needed.
@andriyyeromenko7695
2 жыл бұрын
Please tell me how to use the timer mode "PWM Generation No Output"
@peterdvorak802
4 жыл бұрын
Great video. Any reason not to use prescaler value of 8000 and counter period of 1000? (1ms * 1000 = 1 second cycle) Or prescaler value of 0 and counter period of 7999999 ?
@EngMazen
3 жыл бұрын
There are usually a number of different ways to get to the same result(e.g.16000-1 prescaler, with 500-1 period) The best is to use 80,000 as prescaler and use 100 as period , doing this will make calculation easier. for example you want 50% duty cycle, you just put in the pulse register 50! But!!, the prescaler it not large enough to hold this value, because it is 16-bit(max 65536) There for your first suggestion is better in my opinion
@WetPig
3 жыл бұрын
@@EngMazen Can I change the prescaler value from code? I need to use this to generate a PMW signal, but also need to change the frequency. For example a 10kHz signal with a 10% duty cycle, then a 1kHz signal with a 40% duty cycle and anything in between.
@alirezanikkholgh6123
3 жыл бұрын
thanks.so good
@stmicroelectronics
3 жыл бұрын
Welcome!
@lucaiodice4629
2 жыл бұрын
Really helpful thank you. Just one question: If I need to start and stop the PWM, which is the difference between STOP and STOP_IT?? Because for the START_IT I suppose that every time the counter reaches the desired value there should be the ISR, but for the stop_IT? Thank you
@CandyHam
5 ай бұрын
I am also interested in understanding the usage of START_IT
@GregWoodsLancs
3 жыл бұрын
Really useful video. I cannot see in the code where the CHANNEL1 output pin is set. It is not in MX_TIM2_Init or MX_GPIO_Init (Note: I am using TIm2 on an STM32F411)
@stmicroelectronics
3 жыл бұрын
Glad it was helpful ! For technical questions please join us and your peers in the community at community.st.com/
@mimimmimmimim
2 жыл бұрын
Channel output pins for specific timers are hardcoded in the MCU. There are options though. The part where he moved the first choice default pin PA0 to PA5 is what you're asking, if I got your question right. If you're asking where the heck in the world the pin assignment is made, well, it's hidden quite well in the least expected place of course :D In the source file stem32g0xx_hal_msp.c void HAL_TIM_MspPostInit(TIM_HandleTypeDef* htim) GPIO init is performed... I remember it being kept in its seperate source file for all GPIO assignments when generating for Keil. Maybe I'm wrong. Anyways, line 164 on my project clearly outlines the pin structure and HAL_GPIO_Iniit() is called using GPIO_PIN_O and GPIOA...
@truongho2771
2 жыл бұрын
if CLOCK CONFIG we choose HSE , then CLOCK SOURCE we will only choose Internal Clock
@abdumuminkhan8268
3 жыл бұрын
Hey can you help me please? I tried dedicating the T2 CH1 to the PA5 pin but the software is not letting me
@stmicroelectronics
3 жыл бұрын
Hello, Visit our online community to find answers to your technical questions and share ideas with your developers and ST experts : community.st.com
@ollythebest94
3 жыл бұрын
Nice thanks
@harshaltirse8339
4 жыл бұрын
i need to generate 500Hz frequency using Timer. can you help me with Same board
@pit975k.9
3 жыл бұрын
500 Hz = (8 MHz / 32) / 500. So you set "Prescaler value" 31, "Counter Period" 499 and "Pulse" 250 (to get 50 % PWM). You could also choose other combinations like: 500 Hz = ((8 MHz / 64) / 250); 500 Hz = ((8 MHz / 128) / 125) and so on ...
@simonszz
Жыл бұрын
❤❤❤❤❤❤❤❤❤❤❤
@NoumanAli
2 жыл бұрын
@STMicroelectronics should use a good narrator.
@recomoto
2 жыл бұрын
Man please don't take offense but it sounds like you are eating the mic. It renders the video barely watchable.
@AndiemiX
6 ай бұрын
This tutorial is well made but your software is one of the most terrible software I have evere tried. In an attempt to make it understandable it is completely unusable. Apart from consuming 3 GB of memory for any new project because it re-downloads its stuff (so it is very very bad optimized) it is literally easyer to program microcontrollers in assembly language than using your software.
@adnansayder2148
4 жыл бұрын
SPEAKER MUST BE CHANGE U MUST BE AGAİNT VOİCE RECORD WİTH PROPER ACCENT AND LETTERS
@peterdvorak802
4 жыл бұрын
There is "05 TIM PWM HAL lab.pdf" in above link
@zenkowal3478
4 жыл бұрын
I have a different opinion. No changes needed. And please don't shout.
@ertugbayramyuruk1193
4 жыл бұрын
I absolutely agree with you
3 жыл бұрын
Maybe he is not a native speaker, and you have to pay a bit more attention to his speech, but I think, everything is understandable. Also, respect the fact that they made this valuable information available for free!
@waynet8953
3 жыл бұрын
@ STMicro is headquartered in Europe, so not too surprised a lot have accent.
Пікірлер: 40