You absolutely saved me, I have been trying to get into STM32 and could not get it to work. Finally I found this masterpiece. Thanks a lot!
@randomrickUK Жыл бұрын
Thanks for the kind comment !
@rishikeshtiwari554410 ай бұрын
hey i am from india, can u please help me regarding pwm generation and how to vary duty cycle for stm32f103c8t6 microcontroller
@OSAMAHABDULLAH-pd4eq7 ай бұрын
hi can i contact with you i need your help
@martinlintzgy13612 жыл бұрын
I like the way you explain how and where to find HAL function prototypes. Much easier that the manual.
@randomrickUK2 жыл бұрын
Many thanks for your kind comment.
@tisserandstephane78452 жыл бұрын
Thanks for your work and good explanations . In other words , you speak like a teacher Congratulations
@evertvel2 жыл бұрын
You sir are a hero an have single-handedly saved my schoolwork!!
@7alfatech8602 жыл бұрын
Just watched this video...what a clear explanation! Looking forward to more STM videos from you👍
@OSAMAHABDULLAH-pd4eq7 ай бұрын
hi can i contact with you i need your help
@joaoafonsodossantosmestre8896 Жыл бұрын
Such a clear explanation. Great video! Hope you make more videos like this.
@raphaeltazbaz29622 жыл бұрын
You have no idea how your video helped me on project! thanks a lot.
@MrSlackrick2 жыл бұрын
You are most welcome.
@ajeshnagpal2 жыл бұрын
Thank you for the video, here it very clear and easy way you have explained, thanks again, and please keep on
@m1geo Жыл бұрын
Really useful summary! Thanks! 😁
@ProcrastinatingGameCat Жыл бұрын
Hey man I love this :) if you made a whole STM32 tutorial in this style. I bet more people that I would love it :) great humor also btw
@randomrickUK Жыл бұрын
Thanks, Mr GameCat - much appreciated!
@renatavulnera75732 жыл бұрын
Thank You Rick, Your video (and the code on Github) solved my PWM problem - after 4 days of debugging. Yes, the bottleneck with starting the PWM is there ... I don't like it at all.
@randomrickUK2 жыл бұрын
You're very welcome!
@lamle51833 ай бұрын
I'm still a beginner on this area but thank you for this valuable video! Can I have a question? Do you know how many PWM waves that I can generate from 1 STM32 MCU? And the frequency range that it can generate..? Thanks... and sorry for the beginner question..
@JamaAdam-wh5zw7 ай бұрын
Dear sir thank you for your valuable viode, can you share with me what application you had used for PWm signal display?
@randomrickUK7 ай бұрын
Thanks for the compliment. The application is called Ultrascope, and it comes from Rigol and works only with their oscilloscopes. If you don't already have a scope, there are much better options for viewing signals on a PC. Owon do a USB oscilloscope that's cheap and has much faster update on the computer, or if money is no problem, consider a PicoScope.
@Equalizer-ZA2 жыл бұрын
Great effort Rick .....there's not that much info on stm32. I'm busy building a set of loadcell pedals with an INA122P built amplifier on stm32. Do you perhaps have a discord .....I think I'm gonna need your help
@Ali-jabbar Жыл бұрын
Thank you for sharing the useful video, can you kindly show us how to generate two PWM waveforms for half bridge inverter, as I found it hard to set the timer counting down for the second PWM.
@randomrickUK Жыл бұрын
I think a half-bridge requires two PWMs - each out of phase with each other. In which case, find a timer (TIM1 is an example for the processor I used) which has both a PWM and the negative version available. Example would be TIM1-> PWM Generation CH1 on channel 1 and TIM1-> PWM Generation CH2N on channel 2.
@rishikeshtiwari554410 ай бұрын
please help me i am doing an internship if i would be not able to generate pwm with varying duty cycle i will be get layoff please help me out .... please help me i need this job
@yasirshahzad373211 ай бұрын
AT 5.50 what does the auto-reload preload do? why it's disabled?
@randomrickUK11 ай бұрын
I believe this preload is used when ARR is being dynamically changed. It prevents strange events when the ARR register is updated at certain times. If you want a fixed period/frequency, then you won't be changing the ARR and therefore the pre-load register won't do much for you.
@mejoe444 Жыл бұрын
Hi and thank you first of all. Where can I find which type of interrupts are invoked when using a timer in PWM interrupt mode? (I mean various interrupts are generated in what conditions for the PWM, where are they written). Cannot find any documentation. You say there will be interrupts at falling and rising edges for PWM. Is that all? And is there any file which shows the type interrupts generated during the PWM running?
@randomrickUK Жыл бұрын
Hi - one way to find all of the interrupt types available is to look at the driver files included automatically when you've created your project in CubeIDE. In the Project Explorer, navigate to Drivers -> STM32F0xx_HAL_Driver -> Src. There you can see a file for each subsystem. PWM is a timer function, so the file is called stm32f0xx_hal_tim.c (not the "_ex" file). If you are using a different series of processor to me, then the directory and files will have a slightly different name. If you open that file, you can see a callback function for every type of interrupt available to you. In the case of the very basic STM32F030K6T6 I've used, for PWM its: HAL_TIM_PWM_PulseFinishedCallback and HAL_TIM_PWM_PulseFinishedHalfCpltCallback Hope that helps.
@mejoe444 Жыл бұрын
@@randomrickUK Thanks that was what Im asking. But in the reference manual there is: Table 40. STM32F302xB/C/D/E vector table . This looks like a vector table. Can we also find those two interrupts you mentioned in those tables?
@randomrickUK Жыл бұрын
@@mejoe444 Hi Mo. There isn't a specific interrupt vector for these functions. The Driver file (mine's called stm32f0xx_hal_tim.c) has functions that ARE directly related to the interrupt vectors, but then those functions look at the set-up registers for the timers (or DMA as well, if you are using that), and they call the correct function, depending on how that timer has been configured. Take a look at the HAL_TIM_IRQHandler() function (for me it's in Drivers->STM32F0xx_HAL_Driver->Src->stm32f0xx_hal_tim.c). HAL_TIM_IRQHandler() has 4 calls to HAL_TIM_PWM_PulseFinishedCallback(htim) - each one depends on how the timer registers have been configured, and that in turn depends on how you set that timer up in STM32CubeIDE's CubeMX configurator.
@OSAMAHABDULLAH-pd4eq7 ай бұрын
hi can i contact with you i need your help
@louisefrylinck38592 жыл бұрын
What software did you use to see the waveform? (The one with the yellow logo and Ds written in black)
@louisefrylinck38592 жыл бұрын
Nevermind, I see you already answered. Thanks!
@rishikeshtiwari554410 ай бұрын
hey i am from india can u please help me regarding pwm generation and fow to vary duty cycle for stm32f103c8t6 microcontroller
@randomrickUK10 ай бұрын
That microcontroller also has a TIM3 timer, which means you can set it up the same way I did here. Have you tried doing this? I really need a bit more detail to help you - what did work, what didn't, etc.
@abdoulayebodian3583 Жыл бұрын
Hello Mr. as I can vary the duty cycle on a variable in real time without using a potentiometer ?
@randomrickUK Жыл бұрын
Hi - yes, for sure. You can just set the register (TIM3->CCR1 in my example) to any value between 0 and TIM3->ARR. You can do this anywhere in your code that you wish - it doesn't have to be before you start the PWM output, and you can do it as often as you need to.
@abdoulayebodian3583 Жыл бұрын
@@randomrickUK thank you very much for your availability i did this but the problem is that the value can not be changed in real time. to change the value you have to load it and recompile the program again
@randomrickUK Жыл бұрын
@@abdoulayebodian3583 Are you sure your code is being executed? In my video, near the end, you can see how I dynamically change the duty cycle. I put it in an interrupt callback, but you don't have to do that. It could go in the while (1) loop in main: while (1) { TIM3->CCR1++; if (TIM3->CCR1 == TIM3->ARR+1) TIM3->CCR1 = 0; // go back to 0% duty when 100% reached HAL_Delay(100); } something like that.
@abdoulayebodian3583 Жыл бұрын
@@randomrickUK tank you
@AlcidesRamosZambrano2 жыл бұрын
Hello, excellent, what is the pc osciloscope used?
@randomrickUK2 жыл бұрын
Hi - the oscilloscope is a Rigol DS 1054Z, and the software is Rigol's Ultra Sigma (the driver) and UltraScope (the user interface). You can connect the scope either to your router with an ethernet cable, or to your PC via USB.
@caleb77992 ай бұрын
Why does it feel like I can't breath listening to you speak? It's like you're talking while out of air and silent when you actually breathed. LMAO. Is this just the English way of speaking?