Electronic Basics #30: Microcontroller (Arduino) Timers

preview_player
Показать описание

In this episode of Electronic Basics I will show you how to use the timer of a microcontroller (Arduino Uno -- ATmega328P) to not only create precisely timed events but also generate a PWM signal with variable duty cycle and frequency up to 8MHz.

Music:
2011 Lookalike by Bartlebeats
Рекомендации по теме
Комментарии
Автор

So different of electronics I earned in the late sixties. Have tried to keep up to date on my own. Learned how to fix digital tv's and am now interested in microprocessors .I have ordered a full arduino kit with sensors and learning Python and Linux. Plus I have been following you on You Tube for the great projects you explain. Keep up the great work, You are a good teacher.

Geradovitch
Автор

This is the basics? wow! And here I was thinking that I was smart by using a previousmillis(); function xD

pesterenan
Автор

Having worked with electronics a lot in my life, I always found timers and interrupts to be kind of a dark art, especially before Arduino and when dealing solely with AVR or PIC. Thanks for addressing this :)

MikeysLab
Автор

I feel like you would want to know this: "Mandatory" is usually only used for things that come from human rules, and usually a better word to use is "necessary". Consider "using a precise timer here is mandatory under EEC regulations for electronic products", vs "using a precise timer here is necessary if you want your alarm clock not to drift a lot over time".
Like, wearing a motorcycle helmet is always necessary if you want to be safe, but in some parts of the world it is not mandatory.
I normally wouldn't point that kind of thing out but your English is already pretty excellent so I thought you'd want to perfect it.

RobertMilesAI
Автор

I didn't understand a thing, but great video! ahah

JaySilva
Автор

I have been struggling to understand timer interupts. THIS IS THE BEST EVER! I can now control my steppers using either overflows or compare timers. THANK YOU!

frankone
Автор

I'm about to build a 500 Watt 30V - 42V motor controller for a project I'm working on. I had not yet looked into how to generate stable PWM signals in code without spinning the Arduino in busy waits that eat battery. You've given me some great ideas in this video, so thanks for your time and effort making this.

WarrenGarabrandt
Автор

This is perfect! I have an exam on this today! Thanks for the review Great Scott!

ryanelliott
Автор

Excellent companion to your previous "Arduino Basics 102: Control Structures, Variables, Interrupts" - Love Your Work...

raybright
Автор

I'm writing an arduino sketch to control a stepper while monitoring some sensors. The accelstepper library did not really cut it, for my application. Using this new timer knowledge I was able to make the hardware act exactly as I intended.
HUGE THANKS for this tip.
Awesome GreatScott.

makermonkey
Автор

u can feel the illumunation after watching this 50 time. It is more brighter than the edison's and I'm understanding them now. I loved it!

emrekeremozyurt
Автор

Great video! I really like how you get straight to the point, and pack in as much info as possible. Lengthy videos aren't as entertaining, and even if I have to watch this one a couple times to really get it, I would much rather prefer a shorter video than a longer video. Keep up the good work!

prestonmatheny
Автор

Hey,
the drift off of the millis() function is caused by the Serial.println which takes some clock cycles (depends on baud rate ofc) - the timer is precise in this situation

MinecraftMb
Автор

Thank you for this video! I made a arduino alarm clock a while ago, but because I didn't use a timer, the clock "lost" about 10 minutes every week.

With this information I can finally fix the clock! Thank you!

TheMegaloloful
Автор

This is a great video. Thanks for putting these timers into context with good examples, they make much more sense to me now!

hybridskeeter
Автор

Holy cow... that is another one of your videos i'm gonna need repeat a lot of times to understand

luizz
Автор

Great video! These more advanced videos are great since the amount of videos on how to blink leds is so high and no one really goes that much into advanced arduino / ucontroller functions. Keep at it!

Bartong
Автор

Hello Scott! Remember the clap circuit project? I build it from the first time and put it under my desk and plugged in my pc I enjoy it so much when i come home with one clap I turn on my pc!Greetings from my electronics teacher I showed some your projects to him and he sad:You can learn so much from him.

riassenpai
Автор

best Explanation to that topic I've ever heard

ixinside
Автор

SUCH a good explanation of how to use Arduino style interrupts. You're officially AWESOME.

insightfool