Timer1 PWM Servo Control 🔴 ATmega328P Programming #15 AVR microcontroller with Atmel Studio

  Рет қаралды 11,666

Binder Tronics

Binder Tronics

Күн бұрын

Пікірлер: 41
@Lucas-pj9ns
@Lucas-pj9ns Жыл бұрын
thanks for the clear video love how you explained the datasheet instead of saying just look at the datasheet
@phoemur
@phoemur 2 жыл бұрын
That's awesome. Learned a lot from these tutorials. Good Job. Waiting for the next ones
@West-rq3lu
@West-rq3lu 2 жыл бұрын
Keep up the good work man
@vaibhavwanere3034
@vaibhavwanere3034 Жыл бұрын
Great Work! Thank you so much.
@9700784176
@9700784176 2 жыл бұрын
Thanks!
@BinderTronics
@BinderTronics 2 жыл бұрын
Truly appreciated
@pauseandlearn8626
@pauseandlearn8626 2 жыл бұрын
thank you so much. Could you please add English subtitles if possible? I am so looking forward to the next lecture. Please continue teaching.
@BinderTronics
@BinderTronics 2 жыл бұрын
The automated English subtitles are on and are ferly accurate. It is extremely time consuming to write transcripts. It can take up to 16 hours for a 10min video. I have look into methods to outsource transcripts in a trust worthy manor or I cannot justify the cost.
@suprihandoyo3900
@suprihandoyo3900 6 ай бұрын
thanks
@wilsonguiovannimunozdaza6599
@wilsonguiovannimunozdaza6599 2 жыл бұрын
27:32 realiza este cambio //#define SERVO_MIN (1999u) #define SERVO_MIN (999u) Te funcionará con el recorrido completo
@BinderTronics
@BinderTronics 2 жыл бұрын
Es un servo de 135 grados. Mató a muchos antes de descubrirlo. Mismo proveedor. Mismo producto. Etiqueta incorrecta. It is a 135 degree servo. Killed many before finding that out. Same supplier. Same product. Wrong label.
@WhatTheFuckII2oV3
@WhatTheFuckII2oV3 7 ай бұрын
Maybe you can help me. How do you turn OFF FastPWM AFTER initializing/starting the signal? I was thinking about TIMSK1 &= ~(1
@BinderTronics
@BinderTronics 7 ай бұрын
You want stop the clock of the timer to stop PWM. TCCR1B &= (0b000
@BinderTronics
@BinderTronics 7 ай бұрын
or change the mode of TCCR1A in the WGM1x bits
@fisikamodern5209
@fisikamodern5209 2 жыл бұрын
if there is no pickit, how to program ATMEGA?
@BinderTronics
@BinderTronics 2 жыл бұрын
you don't have a pickit or the pickit is not showing up in the ide?
@fisikamodern5209
@fisikamodern5209 2 жыл бұрын
@@BinderTronics I don't have pickit
@BinderTronics
@BinderTronics 2 жыл бұрын
ISP programmers. Cheap is something that emulates a stk500. Other options are Atmel ice and Mplab snap. You can also use a Arduino UNO but I have no idea if it will work with Atmel Studio. If you are really lucky you can find someone selling a original avrisp mkii.
@fisikamodern5209
@fisikamodern5209 2 жыл бұрын
@@BinderTronics Can USBASP Be an Alternative?
@BinderTronics
@BinderTronics 2 жыл бұрын
USBASP = "Cheap is something that emulates a stk500"
@abidhasanonib9032
@abidhasanonib9032 7 ай бұрын
How can i program multiple servos Simultaneously No one showed this.
@BinderTronics
@BinderTronics 7 ай бұрын
PWM channel per servo. This chip has 4 channels. If you need more use something like a PCA9685.
@9700784176
@9700784176 2 жыл бұрын
20:06 you created a function, pwm_sweep(void). and you have not used that function in the main.c, what is the purpose of creating that function?
@BinderTronics
@BinderTronics 2 жыл бұрын
19:00 quality of life function. It is for testing.
@9700784176
@9700784176 2 жыл бұрын
@@BinderTronics sorry for storming with my doubts. could you please reply in brief, what do you mean by "quality of life function", and how did that function helped/used in testing. I even searched in google, WHAT IS QUALITY OF LIFE FUNCTION, to my dismay, I found nothing. Actually, I'm new to microcontrollers and also to programming. fortunately, I found this video helpful.
@BinderTronics
@BinderTronics 2 жыл бұрын
Quality of life function is my term for it. I use the term mostly for debug functions. The function is identical in function to the main loop just without the conversion from degrees. It allows the user to easily tweak the the min and max range of the servo macros and test if the code is controlling the servo as expected. Once the servo is confirmed to work then the servo_set() function was developed. It comes down to the fundamental of breaking down code into sections and testing bit by bit. Code -> Test -> Debug -> Return to start. I recommend you start using the simulator and start picking the code apart yourself. You will gain much more from it than me explaining it to you. kzbin.info/www/bejne/iHeXXoF4bJxpqNE
@BinderTronics
@BinderTronics 2 жыл бұрын
Full playlist on the ATmega328P AVR microcontroller kzbin.info/www/bejne/eHnVqnZ8rJeIaZI Errata on 1 void pwm_sweep(void){ for(i = SEVRO_MIN; i
@9700784176
@9700784176 2 жыл бұрын
19:00 how this while loop work. as this got no curly braces while(update_pwm_ready != 0); OCR1AH = (i & 0xFF00) >> 8; OCR1AL = (i & 0x00FF); can anyone pls explain. thanks in advance
@BinderTronics
@BinderTronics 2 жыл бұрын
Infinite loop until the condition is not met. You do not need to put anything in the loop. Thus no {}. while(1); for( ; update_pwm_ready != 0 ; ); if(1); All valid syntax.
@9700784176
@9700784176 2 жыл бұрын
@@BinderTronics Thanks for the reply after some google... I found, without braces, only the first statement will run in infinite loop. here, in the code while(update_pwm_ready != 0); OCR1AH = (i & 0xFF00) >> 8; OCR1AL = (i & 0x00FF); the first statement is OCR1AH = (i & 0xFF00) >> 8; when, OCR1AH and OCR1AL, belong to the same register OCR1A. what is the point of running only one half of the register, infinite times.
@BinderTronics
@BinderTronics 2 жыл бұрын
This is what you are looking at. while(update_pwm_ready != 0) { }; OCR1AH = (i & 0xFF00) >> 8; OCR1AL = (i & 0x00FF); This does not run in the loop (i & 0xFF00) >> 8 This will do what you are describing. while(update_pwm_ready != 0) OCR1AH = (i & 0xFF00) >> 8; Note the missing ; after the while.
@markvolf3531
@markvolf3531 Жыл бұрын
10/10 for program, 1/10 for representation, people who already don't know what you are talking about can't understand you.
@BinderTronics
@BinderTronics Жыл бұрын
That's why there is a playlist that takes it from the ground up. I only assume knowledge of C.
@markvolf3531
@markvolf3531 Жыл бұрын
@@BinderTronics Ok, btw I managed to figure it, thanks for the Help, without it I wouldn't make it. Just try to code a little bit slower. +where can I install Atmel studio?
@BinderTronics
@BinderTronics Жыл бұрын
Might want to try Microchip Studio. Atmel studio got renamed. Full playlist on the ATmega328p kzbin.info/aero/PLtuqBdbsL-DvbB6QAGgoGBAEsGuXfGFoF
@christophertadeo6120
@christophertadeo6120 Жыл бұрын
Where's the actual demonstration... 😳
@BinderTronics
@BinderTronics Жыл бұрын
in the video
@9700784176
@9700784176 2 жыл бұрын
Thanks!
@BinderTronics
@BinderTronics 2 жыл бұрын
Thank you much appreciated.
2 MAGIC SECRETS @denismagicshow @roman_magic
00:32
MasomkaMagic
Рет қаралды 27 МЛН
Всё пошло не по плану 😮
00:36
Miracle
Рет қаралды 6 МЛН
СОБАКА И  ТРИ ТАБАЛАПКИ Ч.2 #shorts
00:33
INNA SERG
Рет қаралды 1,4 МЛН
Yay, My Dad Is a Vending Machine! 🛍️😆 #funny #prank #comedy
00:17
PWM in AVR
15:13
DrMattMarshall
Рет қаралды 14 М.
DEC #023 | Arduino PWM modes explained - Atmega328p timers | Part 1
17:31
Digital Electronics Circuits Lab
Рет қаралды 2,1 М.
Electronic Basics #30: Microcontroller (Arduino) Timers
9:19
GreatScott!
Рет қаралды 440 М.
Using Servo Motors with Arduino
43:06
DroneBot Workshop
Рет қаралды 1,4 МЛН
Arduino Uno to ATmega328 - Shrinking your Arduino Projects
37:17
DroneBot Workshop
Рет қаралды 796 М.
2 MAGIC SECRETS @denismagicshow @roman_magic
00:32
MasomkaMagic
Рет қаралды 27 МЛН