STM32 TIMERS #1. PWM Output || DMA

  Рет қаралды 137,451

ControllersTech

ControllersTech

Күн бұрын

Пікірлер: 111
@user-de5du8yb2s
@user-de5du8yb2s Жыл бұрын
7:16 what program did you use to see pulse wave??
@knightdaleknights44
@knightdaleknights44 2 жыл бұрын
Because the output control value changes the moment the CCRx value is reached and the moment the timer overflows, and the timer doesn't overflow until the clock edge after the ARR value is reached, the Duty Cycle should equal CCRx/(ARR+1) and not CCRx/ARR. By adding the "-1" to the "Period" configuration parameter, you are technically setting the ARR value to be one less than what your calculation is using. So when you set the period equal to "10-1", the ARR value is technically 9 (and not 10 as you suggest. And so the equation should have (ARR+1) in the denominator.
@truongtansang7500
@truongtansang7500 3 жыл бұрын
Thanks for this video. I have a question. What type of Logic Analyzer in this video?
@ControllersTech
@ControllersTech 3 жыл бұрын
Sealogic
@bhargavipedada5109
@bhargavipedada5109 Жыл бұрын
Can we do it in Digital Oscilloscope?@@ControllersTech
@ControllersTech
@ControllersTech Жыл бұрын
Yeah why not
@sajalqasim3540
@sajalqasim3540 10 ай бұрын
can we use pwm in fsk transmitter? if yes can you please guide us a little?
@ControllersTech
@ControllersTech 10 ай бұрын
You can use, but you need another hardware which takes the pwm as input and modifies the frequency of the signal based on the input width.
@surajjadhav4529
@surajjadhav4529 2 жыл бұрын
Which software you used to see waveforms?
@ControllersTech
@ControllersTech 2 жыл бұрын
I used a logic analyzer. The software is complementary
@alexandrev.3332
@alexandrev.3332 2 жыл бұрын
There is a error, if you not put DMA Request Settings changing from Normal to Circular the 10 different PWM not work.
@17_gilangrizkisaputra87
@17_gilangrizkisaputra87 Жыл бұрын
What is the name of your application that you use to see PWM signal waves?
@ControllersTech
@ControllersTech Жыл бұрын
Its a hardware, logic analyzer
@17_gilangrizkisaputra87
@17_gilangrizkisaputra87 Жыл бұрын
@@ControllersTech That's cool, thanks mann
@tandungbui5694
@tandungbui5694 Жыл бұрын
7:10 what's the name of app that show the wave?
@ControllersTech
@ControllersTech Жыл бұрын
Saleae
@luizazeredo5197
@luizazeredo5197 3 жыл бұрын
Suas aulas e demostração me ajudam muito ,muito obrigado, sou do Brasil 🇧🇷 e agradeço muito 👍👍
@yudhahamdiarzi5553
@yudhahamdiarzi5553 3 жыл бұрын
Great tutorial, can I use it to control DC motor?
@timowolff1105
@timowolff1105 3 жыл бұрын
Certainly!
@Hfgh564
@Hfgh564 2 жыл бұрын
This is exactly what you need to use to control step motors. Also same technique with floating duty cycle used to make breathing leds
@God_controls_all
@God_controls_all 3 жыл бұрын
ControllersTech! You never disappoint. Thanks a bunch....
@huseyinulupinar392
@huseyinulupinar392 3 жыл бұрын
First of all, it's a very good video. but for example can it take a value processed inside the while loop as pwm with dma?
@ControllersTech
@ControllersTech 3 жыл бұрын
Yes why won't it ? Just update the pwmData at any point in the entire code. The DMA has been assigned with the address if the buffer, not the value. So its doesn't matter what value you pass.
@huseyinulupinar392
@huseyinulupinar392 3 жыл бұрын
@@ControllersTech You are perfect :) thanks...
@dimaabualfoul9281
@dimaabualfoul9281 Жыл бұрын
Thank you very much! I applied each step but with the DMA part I got only 5 pulses (10,..50)us with a period of 200us, is there a specific setting I should add to the DMA controller? thanks again
@Sim_excently
@Sim_excently 4 ай бұрын
How do you display the pulse on the screen?
@kartikeyyendhe1840
@kartikeyyendhe1840 10 ай бұрын
How do you select the value of prescaler??
@icollided
@icollided Жыл бұрын
What software are you using to get the waveforms? I've been using an actual oscilloscope, and it is fine, but having that built into your software looks nice.
@ControllersTech
@ControllersTech Жыл бұрын
Its actually a hardware, logic analyzer. The software is complementary.
@icollided
@icollided Жыл бұрын
@@ControllersTech cool! Thanks. That actially just reminded me that the scope I got has software thay goes with it that I never bothered installing. I should probably try it out.
@sangitamainali2844
@sangitamainali2844 2 жыл бұрын
can you tell me ...what will be the prescaler and counter period for 1 min?
@sridharmakkapati6586
@sridharmakkapati6586 3 жыл бұрын
What's tool used to see the wave form
@Tristoo
@Tristoo 3 жыл бұрын
ooh damn, when I heard the robot voice I thought this was gonna be a garbage video but your english is actually spot on. perhaps speed it up just a little bit in the future?
@janmipunkalani5349
@janmipunkalani5349 2 жыл бұрын
can you tell me, what is the name of that signal-generating software
@sudhansumtripathy
@sudhansumtripathy 2 жыл бұрын
hi, I am a beginner , can you please explain, how many clocks are there, what is internal and external clock, what are the channels, PLL,
@Qaidi_804
@Qaidi_804 5 ай бұрын
How can i generate the sinewave and other waves with STM32F4?
@ControllersTech
@ControllersTech 5 ай бұрын
There is already a video on this channel for sine wave. Please search it.
@rahulrajeeva1863
@rahulrajeeva1863 Жыл бұрын
where to get the user manual, which document you found the "14.4.11 TIM1 and TIM8 prescaler"
@ControllersTech
@ControllersTech Жыл бұрын
User manual for your controller can be downloaded from ST's website. You should have it before you start programming.
@alexandrev.3332
@alexandrev.3332 2 жыл бұрын
Hello, I tryed the part of the code using DMA on STM32F407VET6 and don´t work. I did all the steps, i need help. The other things worked, but DMA not, maybe there is some more configuration to do but i not discover.
@ControllersTech
@ControllersTech 2 жыл бұрын
Check if the interrupt for the respective DMA channel is enabled in the NVIC settings. If not, then enable it and give it some priority. I think the cube have changed some configurations in the recent updates.
@alexandrev.3332
@alexandrev.3332 2 жыл бұрын
@@ControllersTech DMA2 Stream1 Global Interrupt in NVIC is gray and maked but i can´t clean or set, not possible. My version of Cube IDE is 1.10.1
@alexandrev.3332
@alexandrev.3332 2 жыл бұрын
@@ControllersTech It runs one time, but not repeat the pulses again and again, only one time.
@alexandrev.3332
@alexandrev.3332 2 жыл бұрын
@@ControllersTech i did but the pwms appear but one time only and with trigger
@ControllersTech
@ControllersTech 2 жыл бұрын
Need to see the code. Either open a thread on the website, or ask in the telegram/discord groups. Links are in the description
@wolverene1234567890
@wolverene1234567890 4 ай бұрын
A quick question , so what is equal with 1 second :TIM CLOCK of 1Mhz or the FREQUENCY of 10Khz?
@ControllersTech
@ControllersTech 4 ай бұрын
I don't understand the question
@wolverene1234567890
@wolverene1234567890 4 ай бұрын
@@ControllersTech so all your calculation are based on the fact that we will get 10000 lets say pulses in one second and each pulse will be 100us? and out of that 100us we will have 50us Hight and 50 low (this is the duty cycle ) Am I right ?
@ControllersTech
@ControllersTech 4 ай бұрын
Yes.
@wolverene1234567890
@wolverene1234567890 4 ай бұрын
@@ControllersTech thank you
@nicolosantilio4649
@nicolosantilio4649 3 жыл бұрын
Hi, what if I want to control a 50Hz motor with an stm32 which has 16Mhz Clock?
@ControllersTech
@ControllersTech 3 жыл бұрын
Use prescalar and arr to bring the clock down to 50 Hz. Check out the servo motor video in this playlist
@nicolosantilio4649
@nicolosantilio4649 3 жыл бұрын
@@ControllersTech ok so to adapt your video to my needing a i would do 16MHz/50Hz = 320 000. To divide it between the Prescaler and ARR i could do PSC = 8-1 and ARR = 40000-1. But then how to set the duty cycle (ex. 50%) ? Tmr1->CCR = 20000?
@ControllersTech
@ControllersTech 3 жыл бұрын
Yes you got it correct
@nicolosantilio4649
@nicolosantilio4649 3 жыл бұрын
@@ControllersTech oh thanks ;) 🙏
@nicolosantilio4649
@nicolosantilio4649 3 жыл бұрын
@@ControllersTech So the reason why you are able to write 30, 50 and they are actually 30% and 50% duty cycle is just because you have ARR = 100 right? So if I wanted to have the same thing I could write tmR1-> CCR = (x) / 40000 * 100 ? Or am I wrong?
@mehmetcan2240
@mehmetcan2240 3 жыл бұрын
What is the name of the program you are using to see the signal
@ControllersTech
@ControllersTech 3 жыл бұрын
It's a logic analyzer.
@yunesrahem2715
@yunesrahem2715 2 жыл бұрын
the best explenation i have seen , thank you !
@dhruvsharma6031
@dhruvsharma6031 3 жыл бұрын
is this window 11 ??
@firstprinciples9854
@firstprinciples9854 3 жыл бұрын
Such quality content. Nice work. Thanks.
@prasadgawade7752
@prasadgawade7752 Жыл бұрын
ACTUALLY AUTO INSTRUCTIONS ARE NOT COMMING IN MY PROGRAMMING WHAT I DO? ALTHOW I TAP CRTL+SPACE. PLEASE REPLY. IT SHOWS NO DEFAULT PROPOSAL
@ControllersTech
@ControllersTech Жыл бұрын
The cubeide does not auto complete the instructions, you have to press the ctrl + space. Whenever you generate the code from cubemx, build the project once before writing the code.
@prasadgawade7752
@prasadgawade7752 Жыл бұрын
@@ControllersTech thank you I will try.
@hsenaed6894
@hsenaed6894 3 жыл бұрын
Please explain to me the xor mode
@FunSpark-Horizon
@FunSpark-Horizon 3 жыл бұрын
Does anyone know why STM32 MCUs are so rare to find for the past couple of months?
3 жыл бұрын
There is a chip shortage. Too high demand for chips and the production is lagging behind. I saw certain chips with >52 weeks lead time...
@ndidikenneth5135
@ndidikenneth5135 Жыл бұрын
Pls can u upload a use case of multibufferstartIT to generate pwm . I don't really get it and documentation is very poor from st not a single example
@MsSuperasdfghjkl
@MsSuperasdfghjkl Жыл бұрын
Hi. I have a STM32L462 custom board with 40Mhz clock setup. I need to generate pwm for 9600,19200,38400 and 76800 hz. First 3 works fine but 76800 doesnt work. Used a counter to verify. It counts upto 50270 or 51000 only. Its not a very high frequency. So why is there a issue!? Can someone help me!?
@ABYSSOPELAGIC-m4p
@ABYSSOPELAGIC-m4p 4 ай бұрын
When I use STM32f407 dics, pwmData not working. Can you help this problem
@ControllersTech
@ControllersTech 4 ай бұрын
You are either not configuring it properly or using the wolrong pin.
@alexandrev.3332
@alexandrev.3332 2 жыл бұрын
I am using logic analyzer like yours, i put trigger and see the different pwms 10%, 20% to 90% one time, not in cycle, don´t work like you explain, stops and do only one time this presentation. Have to set OUTPUT COMPARE PRELOAD to enable because if you set to disable will not work. So this works only one time and not repeat the signals.
@statstopfinish
@statstopfinish 3 жыл бұрын
How to use DMA to change pulse frequency? DMA changes the value in the CCR register, how to switch the DMA to change in the ARR register?I want to use Timers and DMA to generate pulses for a stepper motor. For a normal start of the stepper motor, you need to smoothly increase the frequency to the specified one and also stop it by smoothly reducing the frequency. STM has Application note AN2820 how to implement this using DMA and timer. But I want to see a video tutorial on how to do it. Can you give a tutorial on how to change the frequency and tune the duty cycle using DMA? thanks
@ControllersTech
@ControllersTech 3 жыл бұрын
I'll check it out
@bakisha
@bakisha 3 жыл бұрын
What is the lower limit of DMA controller? Is it able to push data to CCR1 register, if prescaler is 0 (1) and ARR register is 15 (16 ticks)?
@ControllersTech
@ControllersTech 3 жыл бұрын
You mean how fast the DMA would be able to transfer the data ? There is no definitive answer to that. Also i haven't seen anywhere ST mentioning this. It depends on a lot of factors like your CPU clock, your GPIO speed, the data size etc. So best way is to test yourself.
@bakisha
@bakisha 3 жыл бұрын
@@ControllersTech I was just curious what is the limit of stm32f103c8. But you are right, testing is best way to see. I'll test it on bluepill (clone), so tnx for the video.
@jansijanu4483
@jansijanu4483 2 жыл бұрын
Hi I have tried same method only. But I am not getting any pulse, can you please help me
@ControllersTech
@ControllersTech 2 жыл бұрын
check if you have started the timer in PWM mode or not.
@pranavdhage9858
@pranavdhage9858 3 жыл бұрын
Can we change frequency (variable frequency)as we changed the duty cycle?
@ControllersTech
@ControllersTech 3 жыл бұрын
You can use __HAL_TIM_SET_PRESCALER to change the prescalar.
@riehdjcnxnxdien3439
@riehdjcnxnxdien3439 2 жыл бұрын
@@ControllersTech can i change frequency with dma ?
@zero2717
@zero2717 3 ай бұрын
It's genuinely funny. I did the exact same thing, adapted to my Nucleo C031C6 board, connected it to a Logic analyzer and there's no signal on the pin, just a low active fucking bar.
@Jaegerattacks
@Jaegerattacks Ай бұрын
sad
@ahmetefeakyazi
@ahmetefeakyazi 2 жыл бұрын
Thank you very much, I searched just for this all the day. Problem solved!
@lukeearthcrawler896
@lukeearthcrawler896 3 жыл бұрын
Wonderful tutorial, as usual! :D
@omaiswaseem122
@omaiswaseem122 Жыл бұрын
Best tutorial was so simple to implement
@brothersofficial7926
@brothersofficial7926 Жыл бұрын
There are showing an error during debug of code - ''no st-link detected please connect st-link and start the debug session''. How to solve, plz guide to overcome from this error
@ControllersTech
@ControllersTech Жыл бұрын
As the error says. Connect the st link.
@brothersofficial7926
@brothersofficial7926 Жыл бұрын
Sir another question - from where we can see the PWM pulse after debugging of that code... I mean do we need to install another application??or can we get that in lDE only??
@brothersofficial7926
@brothersofficial7926 Жыл бұрын
@@ControllersTech how i link them
@ControllersTech
@ControllersTech Жыл бұрын
You need to have some hardware like oscilloscope or at least a signal analyzer. Then just connect the pwm output to the analyzer and view the waveform in it's software
@brothersofficial7926
@brothersofficial7926 Жыл бұрын
@@ControllersTech thanks for all
@alexandrev.3332
@alexandrev.3332 2 жыл бұрын
I can send my code to see if there is another problem to run like yours
@abdulhai2201
@abdulhai2201 3 жыл бұрын
Use 32f103 ADC read pwm control
@embedded_eng
@embedded_eng Жыл бұрын
This is why it does not work for some other users; HAL_TIM_PWM_Start_DMA function have to be in the while loop, Otherwise it does not output any signal.
@ControllersTech
@ControllersTech Жыл бұрын
It shouldn't. That defies the purpose of calling the DMA function.
@byatse3013
@byatse3013 2 жыл бұрын
very nice tutorial thank you
@محمدۦۦ-ل6ج
@محمدۦۦ-ل6ج 3 жыл бұрын
Great tutorial bro. THX
@CaliBeta
@CaliBeta 2 жыл бұрын
great video 👏
@offensivebias3965
@offensivebias3965 Жыл бұрын
Thanks for the formulas , there so easy to understand .
@지금이대로좋다-d6c
@지금이대로좋다-d6c 3 жыл бұрын
Nice Video. Thanks.
@shivendrayadav18
@shivendrayadav18 Жыл бұрын
thanku so much
@SergioLopez-vy7xm
@SergioLopez-vy7xm 2 жыл бұрын
very good job
@TeraHertze
@TeraHertze Жыл бұрын
useful thanks
@luismoiseslopezlopez9329
@luismoiseslopezlopez9329 3 жыл бұрын
oh, then that´s the reason that I can´t watch the first video about PWM
@ScienceDiscoverer
@ScienceDiscoverer 5 ай бұрын
The meme voice is kind of distracting.
@caleb7799
@caleb7799 3 ай бұрын
hell no. it's perfect. i don't want to hear any human's voice that's for damn sure.
STM32 MPU Config || #5. MPU Sub-Region setting
11:27
ControllersTech
Рет қаралды 4 М.
STM32 Guide #3: PWM + Timers
20:24
Mitch Davis
Рет қаралды 153 М.
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 67 МЛН
My scorpion was taken away from me 😢
00:55
TyphoonFast 5
Рет қаралды 2,7 МЛН
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН
WS2812 LED with STM32 || PWM using DMA
29:18
ControllersTech
Рет қаралды 53 М.
Lecture 13: Timer PWM Output
16:47
Embedded Systems and Deep Learning
Рет қаралды 107 М.
STM32 TIMERS #3. ENCODER MODE || F103C8
15:41
ControllersTech
Рет қаралды 61 М.
2,000 People Fight For $5,000,000
24:45
MrBeast
Рет қаралды 66 МЛН
How to Make a Real Diamond - (Not Clickbait)
8:51
JerryRigEverything
Рет қаралды 923 М.
The First Amiga Virus - Something Wonderful Has Happened
17:05
Modern Vintage Gamer
Рет қаралды 109 М.
2024's Biggest Breakthroughs in Math
15:13
Quanta Magazine
Рет қаралды 407 М.
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 67 МЛН