The fun thing with STM boards and community in general is that knowledge and stuff used with one board can possibly be applied to another board. Someone could easily use this for its nucleo board
3:27 you calculate the 45*10^6/50 = 900khz you get but your not written in the psc you just writing 900 but why , any formula is there for find out the timer frequncy
@@ControllersTech Ok, I set the APB1 Prescaler value as /8 and and HCLK (MHz) to it's max frequency of 100 MHz in clock configuration. I got the APB1 Timer clock value as 25 Mhz. So, does it mean that i should enter 500-1 in prescaler of timer 2 channel 1 parameter settings because 25 MHz/50Hz is 500000? And is ARR value constant? Shall I put ARR value as 1000-1?
Yes. But the ARR is not constant. You have to divide 500000 between psc & ARR. You can also choose the psc to be 5000 & ARR 100, or psc 50 & ARR 10000. Just remember tgat ARR represents 100% duty cycle, so for small duty percentages it is easier if we keep the ARR high.
i am doing my projects as automatic streetlight system using lora. nucleo board-L073rz LoRa module-sx1272 as l073rz pin configurations are done by suing cube mx software nad keil mdk 5 as a programming language i have chosen. i am having the difficulties of pin configuration and code for street light.... other components i am using ldr and relay and some sensors to detect environmental illumination.so could you please tell me the connections with the nucleo board how to interface lora with that also...
@@ControllersTech MPU6050 GY521 I've seen your video about this ^ sensor and the lcd but I don't understand how to use the values of the MPU6050 GY521 as input for the servo motor. I want to use the sensor like a Wii Mote for the servo motor.
Hi, thanks for the video. One question, from datasheet this servo SG90 has operating voltage at 4.8-6V but you link directly to the pin of the stm32, How?
@@ControllersTech Isn't dangerous plugging Vcc from servo to 5V on nucleo boar? Can it harm the board? Or it depends from board itself (for example: on STM32F103RB it is harmfull, and on STM32F411RE it's not)?
You configure all channels of TIM2 as PWM outputs. Then when you want to write duty cycle of channel_x you replace CCR1 with CCRx; for channel2 CCR2, for channel3 CCR3 and for channel4 CCR4.
Thank you for such Osm video, How you Displayed on LCD-TFT display.? You not used with your code explanation? How do you displayed on it? If now I kindly request you to make make LCD-TFT display to display "hello world" example. Thank you in advance!!!!
Thanks, somehow it doesn't work - I've got no output at PA0 at all. I've got a L476RG - what could be the difference? Is it correct that most important is to have 45MHz/22.5MHz at APB1? Because I have 80MHz max. at HCLK, not 180. So I have 45MHz at HCLK which again leads to 45/22.5 at APB1.
In the tutorial, I am using TIM3 which is connected to APB1 bus, you should find out yours, if u don't get the output contact me in person at help@controllerstech.com
To download code and for more explanation, visit the link in the description
There is no code in the given link
@@greenysan5265 It's at the end of the post...
Thank you, I followed your instructions to program a F103C8.
The fun thing with STM boards and community in general is that knowledge and stuff used with one board can possibly be applied to another board.
Someone could easily use this for its nucleo board
Great video, but how did you get ARR value (1000)
Great channel . Big thanks bro you really help us
Great video, thank you very much :)
I will start using this for my robotics project
Thanks for sharing, can u please share the details of that digital oscilloscope compact?
It's dso138
big thanx bro i love u
3:27 you calculate the 45*10^6/50 = 900khz you get but your not written in the psc you just writing 900 but why , any formula is there for find out the timer frequncy
Because we need 50 Hz..
90 prescaler and 20000 ARR would also work. Is also 50hz
This depends on your TIMER frequency. Any combination can work.. Visit the link in the description, It's explained there
Thank you!
i follow your instruction but servo not run. how you config analog pin ? show help me
how make the servo motor spin reversely?
check the properties of the servo you are using. There are 2 types, one which rotate only 180, and another rotates throughout.
Can you tell me on which PWM pin of STM is the signal pin for servo attached??
How are pins connected to the servo with stm pins?
I ASK TOO
can you control the motor by using potentiometer
Yes use it as a voltage divider
Could you give explanation for the schematic part (between mcu and motor)? i really need this
There are 3 pins vcc, gnd and signal. What explanation you want for that ?
@@ControllersTech i dont know how to connect them
Vcc to 5V
gnd to gnd
signal to PWM pin
Sir, i am using f411re and i have set it to it's max clock frequency of 100 Mhz. What values should i give to the prescalor and counter period ?
2:35
@@ControllersTech Ok, I set the APB1 Prescaler value as /8 and and HCLK (MHz) to it's max frequency of 100 MHz in clock configuration. I got the APB1 Timer clock value as 25 Mhz. So, does it mean that i should enter 500-1 in prescaler of timer 2 channel 1 parameter settings because 25 MHz/50Hz is 500000? And is ARR value constant? Shall I put ARR value as 1000-1?
Yes. But the ARR is not constant. You have to divide 500000 between psc & ARR. You can also choose the psc to be 5000 & ARR 100, or psc 50 & ARR 10000. Just remember tgat ARR represents 100% duty cycle, so for small duty percentages it is easier if we keep the ARR high.
PLEASE CONTINUE
please add for making automatic light system using nucleo board
Can u elaborate ??
i am doing my projects as automatic streetlight system using lora.
nucleo board-L073rz
LoRa module-sx1272
as l073rz pin configurations are done by suing cube mx software nad keil mdk 5 as a programming language i have chosen.
i am having the difficulties of pin configuration and code for street light....
other components i am using ldr and relay and some sensors to detect environmental illumination.so could you please tell me the connections with the nucleo board how to interface lora with that also...
Mail me the details at help@controllerstech.com
PWM video in desc is unavailable
Updated. Please check again.
@@ControllersTech 👍
Is there anyway to control the speed of rotation of the servo?
I don't think so
@@ControllersTech Thanks. Need to find a motor I can adjust both position and speed.
Go for stepper motor
@@ControllersTech Was thinking that. Is it like I can adjust speed using PWM?
@@ControllersTech I found your other video. Thanks!
Hello, i cant use htim2.Instance->CCR in a for loop i dont know why help me pls
don't forget the channel number at the Capture Compare Register (CCR). if you are using channel 1, it would be CCR1, so htim2.Instance->CCR1 = foo;
YOU SAVE MY LIFE thanks. n_n
If i am using a chanell 2 will i be using ccr 2 ?
Yes
Do you have a video explaining the configuration for the comunication trow the RX and TX? Sorry for my bad English.
Yeah it's there look in the videos
how to program STM32 from MATAB
Good video
Thanks for your video!
I have a question.
What do I have to do if I use a sensor from which get the angle of rotation of the servo motor?
What sensor ?
@@ControllersTech MPU6050 GY521
I've seen your video about this ^ sensor and the lcd but I don't understand how to use the values of the MPU6050 GY521 as input for the servo motor.
I want to use the sensor like a Wii Mote for the servo motor.
Hi, thanks for the video. One question, from datasheet this servo SG90 has operating voltage at 4.8-6V but you link directly to the pin of the stm32, How?
Stm32 have 5V output. Just connect there
PA0 is 3.3V in oscilloscope, so signal at 3.3V and power at 5V, i'm right?
Yeah but as we are using PWM, signal is not exactly 3.3v. it's changing and based on that servo rotates
dou you use the 5v output from den nucleo board?
Yes
@@ControllersTech Isn't dangerous plugging Vcc from servo to 5V on nucleo boar? Can it harm the board? Or it depends from board itself (for example: on STM32F103RB it is harmfull, and on STM32F411RE it's not)?
Hii I have a question, do you have any idea how we can do servo motor on and off using uart protocol and USB to TTL converter??
we can do it
Why the position at 0.5ms is 0, and at 1.5ms is 90?
That's how the servo motor works.the rotation is based on the width of the pulse you provide
How to Circuit Servo and STM32 ??
Do u mean how to connect ?
There is only one data pin in servo, just connect it to the PWM channel of the timer, that you are using..
@@ControllersTech I connect :
RED --> (+5V)
PA0 --> ORANGE (PWM pin)
GND --> BROWN (GND)
and I create code like you But my servo doesn't spin.
What controller ?
What timer you are using ?
What's the apb1 and apb2 clocks ?
Whats the prescalar and arr values ?
Aprendendo muito com suas aulas, Muito obrigado (BR). /*End*/
Which Pin you use on the Nucleo Bord for PWM output?
It depends on which pwm you use. For pwm1 its A1
what to do if i need to control 4 servos separately??
You configure all channels of TIM2 as PWM outputs. Then when you want to write duty cycle of channel_x you replace CCR1 with CCRx;
for channel2 CCR2,
for channel3 CCR3 and
for channel4 CCR4.
hello i need program about pwm phase shift in STM32
Hello, How can I change speed of servos moves ?
We can't change the speed. All we can do is change the time for which the motor rotates..
Thank you for such Osm video, How you Displayed on LCD-TFT display.? You not used with your code explanation? How do you displayed on it? If now I kindly request you to make make LCD-TFT display to display "hello world" example. Thank you in advance!!!!
I am not using this TFT as a display. It is dso138 and it is already programmed to work as an oscilloscope.
I'll make a video on TFT soon.
why Input frequency 8Mhz?
why Counter period 1000?
why prescaler 900?
why-1?
ALL explained in the link in the description
"why-1" - not explained
Because the mcu adds 1 to the value. It's given in the datasheet..
That's why by default its 0 while actually it is applied as 1
Thanks, somehow it doesn't work - I've got no output at PA0 at all. I've got a L476RG - what could be the difference? Is it correct that most important is to have 45MHz/22.5MHz at APB1? Because I have 80MHz max. at HCLK, not 180. So I have 45MHz at HCLK which again leads to 45/22.5 at APB1.
In the tutorial, I am using TIM3 which is connected to APB1 bus, you should find out yours, if u don't get the output contact me in person at help@controllerstech.com
Did not work at all. It says "could not connect to J-Link".
Do you have a j link ? What controller are u using ?
thanks/