Timer Interrupt ISR + Examples | Arduino101 | Set Registers & Modes

Поділитися
Вставка
  • Опубліковано 12 лип 2024
  • Keysight University Giveaway: bit.ly/ENoob_KULive
    Subscribe to Keysight Labs channel: / keysightlabs
    Watch the first KU Live: • Win Test Gear + Keysig...
    KU Live event’s full write-up: bit.ly/KU_Overview​
    🔥Another class for the Arduino 101 series. This time we see how to control the timer interrupt. Set the resisters and then see how to trigger an ISR each time. See what modes we have and what we could do with this...
    🔀LINKS
    -------------------------------------
    Tutorial Website: electronoobs.com/eng_arduino_...
    ATmega328p datasheet: bit.ly/3csU1i6
    Get Arduino UNO: www.banggood.com/custlink/mvv...
    Arduino Course (Spanish): bit.ly/3ldW6kO
    🤝SUPPORT
    -------------------------------------
    ELECTRONOOBS.io: electronoobs.io
    Help my projects on Patreon : / electronoobs
    my Q&A page: electronoobs.io/forum/index.php
    Facebook page: / electronoobs
    Canal en Español: / electronoobs en español
    00:00 Intro
    01:51 Functions that use Timers
    02:34 What is a timer?
    03:16 The Prescalar
    04:58 ISR modes
    06:28 Compare Match Mode
    08:11 Why use the Prescalar
    13:20 Example 1
    14:04 PWM Example
    15:42 Outro
    Like share and subscribe to motivate me. Thank you
    #Arduino
    #tutorial
    #Timer
  • Наука та технологія

КОМЕНТАРІ • 131

  • @ELECTRONOOBS
    @ELECTRONOOBS  3 роки тому +10

    Arduino Course (Spanish): bit.ly/3ldW6kO
    Follow me on FACEBOOK for more: facebook.com/Electronoobs
    Help me on Patreon: www.patreon.com/ELECTRONOOBS

  • @gian-227
    @gian-227 10 місяців тому +7

    IMPORTANT: if you have copied and pasted sources be careful because the PWM example source provided by the author has an error. Indeed it lacks the TCCR1A configuration "TCCR1A |= B00000111;" in the setup... In the video it's present but in the source file on the website it's not. However, very detailed video! Nice work!

  • @nelsonnegrinho2889
    @nelsonnegrinho2889 2 роки тому +6

    Thank you so much for this masterpiece!!!! I am definitely going to watch all of the episodes. Please do not stop making these videos until the series is complete.

  • @mechee1747
    @mechee1747 3 роки тому +6

    Amazing explanation of timers! I gained a lot of new knowledge on it where it was pretty much a black box to me before!

  • @Kang38290
    @Kang38290 3 роки тому +16

    YASSSSS!! iwanted to learn about this for such a loonngg time!!!

  • @user-ln6zl6od8x
    @user-ln6zl6od8x 11 місяців тому

    This video has been a lifesaver for me.. I really couldn't figure out the ocrna values for such a long time and this video has helped me alot.. thank you for this eye-opener:)

  • @vsapre80
    @vsapre80 3 роки тому +5

    Very nice explanation.
    In a recent project, I had created an timer event based cooperatively scheduled setup of tasks, based on a basic timing tick of 1ms, using a timer other than the one used by delay() etc. Interestingly, it works very well. As long as you develop and use all timing functions based on your basic time tick. The use of Arduino delay(), millis() is then prohibited because though the timing tick interrupt would work, any calculations done in the ISR would not function, if the delay() is going on.

  • @shanesrandoms
    @shanesrandoms 3 роки тому

    Always enjoy your videos on electronics..always able to learn something or understand something better. Keep up the great videos.

  • @stever3886
    @stever3886 Рік тому

    Probably the best video I have seen on this topic! Great explanation a little fast paced for me but I can watch the video again. Thank you for sharing your skills and knowledge. I think I could apply this to control the speed the servo arm moves. Currency using delay but I have to get away from delay and advance to this method.

  • @easyelectronics4364
    @easyelectronics4364 3 роки тому +3

    Beautifully explained❤️

  • @talhaakhtar6172
    @talhaakhtar6172 2 роки тому +1

    Soo informative and easy to understand... Reflects your understanding on this topic... And not to forget about the added animation helps a lot to a beginner like me...

  • @soumitratewari483
    @soumitratewari483 3 роки тому +5

    Sir we never miss your any of your videos. We watch them all. Your teachings are great !!! Thank you Sir.

  • @Soumendu13
    @Soumendu13 3 роки тому +1

    I appreciate your hard work, it helped me a lot.

  • @ezzeldin101
    @ezzeldin101 3 роки тому +4

    Stay smart and creative as usual💖💖🎇

  • @advanceringnewholder
    @advanceringnewholder 2 роки тому

    This is by far the best explanation on how to use a timer. At least for me

  • @y2ksw1
    @y2ksw1 3 роки тому

    Very nice. This knowledge makes Arduino much more attractive.

  • @raksss000
    @raksss000 3 роки тому +1

    Great video! You are explaining things in very correct order. Just a kind suggestion, It would be much appreciated ,if you could add transcript of your videos under Description section of each video !!

  • @lucianomaia9460
    @lucianomaia9460 3 роки тому

    Thank you! I needed to understand this for a project

  • @marcus1379
    @marcus1379 4 місяці тому

    Amazing video! Thanks for the great amount of effort you put into your videos.

  • @freewarekr
    @freewarekr 3 роки тому

    I saw it well. The equipment that appears in the video is good, and the graphics in the video are good.

  • @anuragmahajan5919
    @anuragmahajan5919 Рік тому

    Thank you for this video, I just love the explanation, you cleared up so many things for me and that too with code!
    Thank you!

  • @Balgenwatz
    @Balgenwatz 2 місяці тому

    This truely is a masterpiece. This is gods work

  • @doctorgreatengineer6834
    @doctorgreatengineer6834 3 роки тому +2

    I want more videos like this that's related to the core of arduino. please make more videos on arduino 101 series.

  • @raagamparmar179
    @raagamparmar179 3 роки тому

    Finally! I wanna learn this for so long......👍👍👍👍👍👍👍👍

  • @yogpanjarale
    @yogpanjarale 3 роки тому +1

    The video i was waiting for 🙂

  • @Donder1337
    @Donder1337 2 роки тому

    Yeah i was looking into this, but with your example its much easyer to understand :) thx :>

  • @rochanawasthi1252
    @rochanawasthi1252 3 роки тому +1

    Just love your videos

  • @voidex136
    @voidex136 Рік тому

    Amazing explanation!

  • @pixmooo1
    @pixmooo1 3 роки тому +1

    Nice video, you show us really hidden facts about arduino...thanks friend👍👍🌹🌹from 🇮🇶🇮🇶

  • @buiquochoang8208
    @buiquochoang8208 2 роки тому

    thanks for the solution, it's really helpful

  • @apoorv360
    @apoorv360 11 місяців тому

    Amazing....i had to watch 2-3 times to get full grasp of the topic...it will be very helpful to me...thanks

  • @darshananvekar5389
    @darshananvekar5389 3 роки тому

    Very interesting and helpful.

  • @kleindavid9416
    @kleindavid9416 4 дні тому

    Great explanation, thank you! (Struggling for a while to understand this, so... thanks!)

  • @ignition_electronics2520
    @ignition_electronics2520 3 роки тому +1

    Thanks this is helpful 👍

  • @VorpalForceField
    @VorpalForceField Рік тому

    Top Tier Content ... Thank You for sharing.. Cheers :)

  • @icarossavvides2641
    @icarossavvides2641 2 роки тому

    Nice to see lots of comments in your code!

  • @electronic7979
    @electronic7979 3 роки тому +1

    Helpful video 👍

  • @ezzeldin101
    @ezzeldin101 3 роки тому +2

    thank u man

  • @scottneels2628
    @scottneels2628 Рік тому

    Thank you!

  • @abdulkadirgozuoglu8946
    @abdulkadirgozuoglu8946 3 роки тому +1

    wonderfull, thank you:))

  • @rajendrashakyawal7606
    @rajendrashakyawal7606 3 роки тому

    Very nice and thank you

  • @toolzshed
    @toolzshed 3 роки тому

    Awesome ElectroNoob!

  • @your.free.electrons
    @your.free.electrons 3 роки тому

    Very informative one...

  • @sefalibhakat143
    @sefalibhakat143 3 роки тому

    Thank you very much

  • @deepabnair7411
    @deepabnair7411 3 роки тому

    Bro you are great 😚

  • @khomo12
    @khomo12 14 годин тому

    Very nice!👍👍👍 Thank you!

  • @behzadabf
    @behzadabf 3 роки тому

    wellll describe.. thank you..

  • @siddharthmali5841
    @siddharthmali5841 3 роки тому

    Excellent.

  • @sudheerkumar5966
    @sudheerkumar5966 Рік тому

    Very good sir

  • @C4ndyD4rling
    @C4ndyD4rling Місяць тому

    I really like this 101 playlist.. Thanks man.. Easier to understand how to use sensors and peripherals. I still hope we can see how U write library for some device or IC..

  • @FixTronics
    @FixTronics 3 роки тому

    Thanks noobs
    Another great video as always

  • @ranganatennakoon
    @ranganatennakoon 3 роки тому

    101 thanks !!!

  • @YouGenom
    @YouGenom 3 роки тому +1

    Nice video thanks! The timer 1 (second timer 16bit) animation should go to 65535 instead of 65536 :) Edit: another typo later in the table.

  • @MR_GOLD_LINVENTEUR_237
    @MR_GOLD_LINVENTEUR_237 3 роки тому

    Thank electronoobs for this vidéos série
    Please for the futur make vidéo to explaint how to send many channel to serial transmitter hc 12 module

  • @vipinchoudhary2787
    @vipinchoudhary2787 3 роки тому

    Hi,
    Yours video are more informative than Great Scott's video. Please make a video on advance universal program that can be used for any program. Same program is available on EE Enthusiast UA-cam channel. If you can explain the each part of that program in depth and some better modification ,that will best video of your channel. I hope we will get notification of that video soon. Keep doing good work👍.
    Regards
    Vipin Choudhary

  • @uvrjj
    @uvrjj 2 роки тому

    Superbbbb

  • @ThatJay283
    @ThatJay283 Рік тому

    nice vid! also you kinda sound like GreatScott!

  • @mtalhakhalid1679
    @mtalhakhalid1679 2 роки тому

    good video sir similar to 8051 microcontrollers i use interrupt and timer in that unfortunately 8051 had 2 timmer and 2 interrupt 8 bit register

  • @rochanawasthi1252
    @rochanawasthi1252 3 роки тому

    Also participated in one of your diy competition

  • @nektarioskourakis8331
    @nektarioskourakis8331 2 роки тому

    Great work ! Can you show , create a nanosecond timer ? For example Trigger a device ,start timer, and stop it when a analog pin pass a threshold . Thanks

  • @sreeharibalachandran
    @sreeharibalachandran 2 роки тому

    Superb Video :) Thanks :). Is it possible to use timer 1 (16 bit) to create a function similar to micros(), having 1us resolution?

  • @gustavosilva3149
    @gustavosilva3149 2 роки тому

    Great video, thank you for the explanation. I would like to know if the same code could work in Arduino Mega?

  • @techieelectro
    @techieelectro 3 роки тому +1

    What's up my friend 😊👍

  • @AtiqurRahman-gj6mg
    @AtiqurRahman-gj6mg 3 роки тому

    Best

  • @omkharde2325
    @omkharde2325 3 роки тому +1

    Please make a video on how to upgrade your 6 channel transmitter to 10 + channel.😃

  • @manoftheday1
    @manoftheday1 3 роки тому

    Thanks for all your efforts but please when are you going to conclude your mppt video am waiting for its final part please.

  • @micah2936
    @micah2936 11 місяців тому

    So with a prescalar max of 2^10 and a clock speed of 16x10^6, and a 16 bit timer, the max interrupt time interval is only 4194 ms.
    If we let T be the timer compare value, P be the prescalar, C be the clock, b be the number of bits in the timer, and u be the desired delay time, we can write a function of TP=uC
    where T

  • @cemyasam
    @cemyasam 2 роки тому

    Hello brother, congratulations on your very successful content. Can you activate subtitles in the video? I can't understand because there is no subtitle

  • @gokuzraj2566
    @gokuzraj2566 3 роки тому

    Hi electronoobs! The last video you uploaded on rasbi pico was a ELECTROBOON!!! Could you please do projects on rasbi pico . it would be awesome!!!!

  • @saneeshelectronica9293
    @saneeshelectronica9293 3 роки тому

    i have an encoder giving 100 - 400 pulses per second channel A & B my speedo meter has 5% error i need to increase 5% frequency after feeding to Arduino and get frequency increased by 5% both channel A& B. could you please help (for examble 100 hz becomes 105 hz both channel)

  • @aniveshchaturvedi9886
    @aniveshchaturvedi9886 10 місяців тому

    Sir we want to make a time totolizer for arduino means it should not reset if power ofd.
    Relay need to high after set time

  • @saurabhgawli2167
    @saurabhgawli2167 3 роки тому

    Sir. Plz do a video on long range wired sensors and long range LED PWM control and power supply. Plz sir..

  • @shrikantnikam2426
    @shrikantnikam2426 Рік тому

    can we use timer 1 for more than one interruption at same time?

  • @DIYwithBatteries
    @DIYwithBatteries 3 роки тому

    Heyyy 😃👍

  • @FIXDIY
    @FIXDIY 3 роки тому +1

    جيد

  • @RicciLuca-ATSsrls
    @RicciLuca-ATSsrls 11 місяців тому

    very interesting video congratulations.
    I'm Italian and I wanted to ask if you can somehow enable subtitles for easier understanding
    Thank you

  • @oluwadamilolaaluko27
    @oluwadamilolaaluko27 2 роки тому

    Hi could you do the same video on esp32 ?

  • @newbie952
    @newbie952 2 роки тому

    Is there any library we need to define before the code?

  • @surajmate8047
    @surajmate8047 3 роки тому

    Please explain Inputcaptur mode

  • @benwhite2429
    @benwhite2429 3 роки тому

    If you have too many calculations such as sensor readings in the interrupt routine, is it possible it will take too long to read them and interrupt itself?

  • @SumitSharma-do8ye
    @SumitSharma-do8ye 3 роки тому

    Which software u use for animations

  • @engrjolo1631
    @engrjolo1631 3 роки тому

    Are all the countries are included in the giveaway?

  • @08acbest
    @08acbest Рік тому +1

    Actually, 11:35 the correct value of OCR1A should be 31249, check the datasheet. Also, 14:59 the analogWrite function has 10-bit precision, not 8 bits

  • @Ais-qc1bc
    @Ais-qc1bc 2 роки тому

    sir, i use softowerSerial lib for 433 but servo not work with this libary! please make a video on it..
    or say something what can i do...

  • @rameshboina8832
    @rameshboina8832 3 роки тому

    Bro can u make time telling clock every hour useing pic ic project please Or reply me

  • @Electrologia
    @Electrologia 2 роки тому

    7:25 How can I find PWM register control? Would you please make a video? :) Thanks

  • @ishanimakwana5972
    @ishanimakwana5972 2 роки тому

    what should be the value of pulses for 500microseconds???

  • @AnandKumar-ym9yw
    @AnandKumar-ym9yw 3 роки тому

    😍

  • @bobmirror7164
    @bobmirror7164 3 місяці тому

    Is there any open source code for Arduino to open and close a house window with a stepper motor actuator 10 or more times in a day; code that one can edited the hours to open and close a house window? Maybe someone made a library to do this. I can not find anything.

  • @prathambumb5593
    @prathambumb5593 3 роки тому

    👍🏻

  • @shashankarmy
    @shashankarmy 3 роки тому

    Please make arduino Resign Printer

  • @HarisMaulanaID
    @HarisMaulanaID 3 роки тому

    Make tutorial video STM32 Project with STMCubeIDE

  • @andreiciora2765
    @andreiciora2765 3 роки тому +2

    Mie mi-ar prinde bine un osciloscop și un generator de semnal , deoarece eu folosesc mai bine de 1,5 ani un osciloscop și un generator de semnal facut de mine cu arduino . Asa ca unul dintre acestea m-ar ajuta mai tare deoarece ar fi mai precis .

  • @Shubham-po2tp
    @Shubham-po2tp 3 роки тому

    Can you please make vedio
    Of buck converter circuit
    In which output 5volt fixed voltage
    Ieven though
    Input lie between 6v to 15 volt
    I want to replace 7805 by this ckt
    If possible please Also tell us about changes in ckt to get 9 volt fixed voltage
    By inputting 10- 15 volt
    If vedio not possible share pdf link of calculation which can find required circuit values for fixed output
    Please help by reverse engineering
    Of such 5v fixed output from 6-12v input circuit

  • @bogdan546
    @bogdan546 3 роки тому

    How do I create a pwm signal with a encoder ?

  • @jboy4real
    @jboy4real 7 місяців тому

    You are two fast make it simple and explain gently

  • @stephensu4371
    @stephensu4371 3 роки тому +3

    interrupt, remind me the assemble language

  • @nicholastzane3466
    @nicholastzane3466 Рік тому

    Very nice video.
    Just a little more explanation please on 10:47
    1) You say that TCCR1B |= B00000100 is the same as TCCR1B = B00000010
    Since we set TCCR1B = 0 why doesn't TCCR1B |= B00000100 equal TCCR1B=B00000100 ?
    2) You say that TCCR1B |= (1

  • @youssefahourri3245
    @youssefahourri3245 3 роки тому

    When you attend a lesson of the 4th grade instead of the 1st one and you realise at the end that you need to study a lot to understand what is mentioned in that class 😃😃

  • @rochanawasthi1252
    @rochanawasthi1252 3 роки тому

    Hi