STM32CubeIDE basics - 05 TIM PWM HAL lab

  Рет қаралды 61,737

STMicroelectronics

STMicroelectronics

Күн бұрын

Learn how to create your STM32 based application using STM32CubeIDE
STM32CubeIDE can be used to create applications for STM32 devices using STM32Cube libraries (HAL and Low Layer versions).
Benefits you will take away
• Understanding how to create Hardware Abstraction Layer (HAL) based examples on STM32 devices
• Understanding how to create Low Layer based examples on STM32
• Understanding how to manage software components and generated projects within STM32CubeIDE tool
Prerequisites
• NUCLEO-G071RB board
• microUSB cable
• PC with MS Windows OS (in version 7 or higher) with preinstalled the following software:
o STM32CubeIDE with STM32G0 Cube library preinstalled (libraries installation instruction present within “Repository management” video)
Complete set of slides:
drive.google.com/file/d/1qEyO...

Пікірлер: 40
@FirstLast-ih6ec
@FirstLast-ih6ec 3 жыл бұрын
At last. A tutorial I could follow and have a timer driving an output. Thanks.
@pranjal3727
@pranjal3727 3 жыл бұрын
Love it. Thanks. It's just small kick-start which let me shed the fear of non-arduino micros.
@MicaCZ
@MicaCZ 3 жыл бұрын
Really helpful and straight forward. Thank you!
@stmicroelectronics
@stmicroelectronics 3 жыл бұрын
Glad to hear !
@elais5785
@elais5785 2 жыл бұрын
Thanks a lot!! This was very useful for a school project!
@kenwallace6493
@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
@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
@andriyyeromenko7695 2 жыл бұрын
Please tell me how to use the timer mode "PWM Generation No Output"
@RiffRaff109
@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
@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
@gabrielvigiano 3 жыл бұрын
HAHAHA thats it...
@klausrolland4121
@klausrolland4121 3 жыл бұрын
You are right, it would be really helpful to see how to change the duty cycle programically after the initial setup
@klausrolland4121
@klausrolland4121 3 жыл бұрын
There is a macro for that: __HAL_TIM_SET_COMPARE(&htim1, TIM_CHANNEL_1, pulse_width);
@otabektillavayev3309
@otabektillavayev3309 Жыл бұрын
Thanks of millions
@lucaiodice4629
@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
@CandyHam 4 ай бұрын
I am also interested in understanding the usage of START_IT
@peterdvorak802
@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
@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
@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.
@ollythebest94
@ollythebest94 3 жыл бұрын
Nice thanks
@GregWoodsLancs
@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
@stmicroelectronics 3 жыл бұрын
Glad it was helpful ! For technical questions please join us and your peers in the community at community.st.com/
@mimimmimmimim
@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...
@abdumuminkhan8268
@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
@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
@alirezanikkholgh6123
@alirezanikkholgh6123 3 жыл бұрын
thanks.so good
@stmicroelectronics
@stmicroelectronics 3 жыл бұрын
Welcome!
@harshaltirse8339
@harshaltirse8339 3 жыл бұрын
i need to generate 500Hz frequency using Timer. can you help me with Same board
@pit975k.9
@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 ...
@truongho2771
@truongho2771 Жыл бұрын
if CLOCK CONFIG we choose HSE , then CLOCK SOURCE we will only choose Internal Clock
@simonszz
@simonszz Жыл бұрын
❤❤❤❤❤❤❤❤❤❤❤
@NoumanAli
@NoumanAli 2 жыл бұрын
@STMicroelectronics should use a good narrator.
@recomoto
@recomoto 2 жыл бұрын
Man please don't take offense but it sounds like you are eating the mic. It renders the video barely watchable.
@AndiemiX
@AndiemiX 5 ай бұрын
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
@adnansayder2148 4 жыл бұрын
SPEAKER MUST BE CHANGE U MUST BE AGAİNT VOİCE RECORD WİTH PROPER ACCENT AND LETTERS
@peterdvorak802
@peterdvorak802 4 жыл бұрын
There is "05 TIM PWM HAL lab.pdf" in above link
@zenkowal3478
@zenkowal3478 4 жыл бұрын
I have a different opinion. No changes needed. And please don't shout.
@ertugbayramyuruk1193
@ertugbayramyuruk1193 3 жыл бұрын
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
@waynet8953 3 жыл бұрын
@ STMicro is headquartered in Europe, so not too surprised a lot have accent.
STM32CubeIDE basics - 06 Repository management
8:05
STMicroelectronics
Рет қаралды 22 М.
STM32CubeIDE basics - 10 ADC DMA TIM HAL lab
31:32
STMicroelectronics
Рет қаралды 58 М.
УГАДАЙ ГДЕ ПРАВИЛЬНЫЙ ЦВЕТ?😱
00:14
МЯТНАЯ ФАНТА
Рет қаралды 2,4 МЛН
ПРОВЕРИЛ АРБУЗЫ #shorts
00:34
Паша Осадчий
Рет қаралды 6 МЛН
ОСКАР vs БАДАБУМЧИК БОЙ!  УВЕЗЛИ на СКОРОЙ!
13:45
Бадабумчик
Рет қаралды 6 МЛН
STM32 Guide #4: Generated Code, HAL, and Bare Metal
26:20
Mitch Davis
Рет қаралды 78 М.
STM32CubeIDE basics - 03 GPIO HAL lab
17:50
STMicroelectronics
Рет қаралды 74 М.
I Melted Wood With Friction
8:44
The Action Lab
Рет қаралды 632 М.
STM32CubeIDE basics - 12 FreeRTOS basic lab
32:39
STMicroelectronics
Рет қаралды 27 М.
Stm32 Timers in PWM mode
37:44
Eddie Amaya
Рет қаралды 48 М.
STM32 DMA and FreeRTOS Tutorial - Phil's Lab #14
29:10
Phil’s Lab
Рет қаралды 112 М.
STM32CubeIDE basics - 11 USART HAL lab
10:55
STMicroelectronics
Рет қаралды 62 М.
Lecture 13: Timer PWM Output
16:47
Embedded Systems and Deep Learning
Рет қаралды 104 М.
STM32CubeIDE basics - 08 Project management
25:42
STMicroelectronics
Рет қаралды 25 М.
Look, this is the 97th generation of the phone?
0:13
Edcers
Рет қаралды 3,5 МЛН
Top 50 Amazon Prime Day 2024 Deals 🤑 (Updated Hourly!!)
12:37
The Deal Guy
Рет қаралды 1,4 МЛН
Todos os modelos de smartphone
0:20
Spider Slack
Рет қаралды 57 МЛН
Это Xiaomi Su7 Max 🤯 #xiaomi #su7max
1:01
Tynalieff Shorts
Рет қаралды 906 М.
Сколько реально стоит ПК Величайшего?
0:37