Learn to use Hardware, Pin Change and Timer Interrupts with the Arduino Uno.
Article with code: https://dronebotworkshop.com/interrupts
Today we are working with a fundamental programming concept, the use of Interrupts.
Now, this certainly isn't the first time we have worked with interrupts, we have used Hardware Interrupts in several previous videos. But we have never taken a deep dive into the subject, and as it is a very important concept, I feel it's time that we did!
Plus, Hardware Interrupts are just one of three types of interrupts supported by the Arduino. So we also should take a look at Pin Change and Timer Interrupts as well.
We are working with an Arduino Uno today, but the concepts we are discussing are applicable to just about any microcontroller.
Interrupts can help you make more responsive user interfaces, perform timed operations, or just write better and more efficient code.
Here is the Table of Contents for today's video:
00:00 - Introduction
01:51 - No Interrupt Demo
07:02 - Hardware Interrupts
19:51 - Pin Change Interrupts
37:22 - Timer Interrupts
46:21 - Conclusion
Hopefully the video and its associated article will prove to be a good resource as you work to improve your code with interrupts.
😎
Bill
"Never trust a computer you can’t throw out a window." — Steve Wozniak
Great video and article, it's helped my understanding of interrupts. One thing confuses me - the Atmega328p datasheet has a clock bit selection table for Timer2 saying that you can have 128, 256 and 1024 prescalers. The table in the article does not have these. Is there a reason for the mismatch?
Bill,
Really enjoyed the video, which deals with several subjects many find tricky and fiddly. The three topics build very nicely one to the next but equally stand alone.
An excellent primer for anyone starting to get to grip with these subjects and techniques.
I would say that the most difficult topic to get heads around is Timer Interrupts. I came across a very useful resource some time ago I always use when configuring timer interrupts on Arduino which readers may find equally helpful.
The site can be found here.
Many thanks
Ron B
Ron Bentley
Creativity is an input to innovation and change is the output from innovation. Braden Kelley
A computer is a machine for constructing mappings from input to output. Michael Kirby
Through great input you get great output. RZA
Euler rocks!!