Microcontroller interrupts are one of the big tools in our embedded programming arsenal. They make the chip listen for particular events, and once detected they stop what they’re doing and run a separate set of code called and Interrupt Service Routine. We’ve come across two fairly new tutorials on the subject that you should check out if you’re not yet a master on the topic. One is a ProtoShack tutorial on ATmega168 external interrupts, and the other is a Newbie’s Guide to AVR Interrupts by [Dean Camera] (we’ve been a fan of his tutorials for some time). Both cover a range of topics from what interrupts are, to avoiding the common problems of volatile data types and the compiler optimization caveats.
What can you do with interrupts? External interrupts can be used to wake up a project like this LED menorah from sleep mode. Interrupts can be used to monitor a timer for a certain value or an overflow for use in generating a pulse-width modulation signal. The TI Launchpad uses an interval timer interrupt for button debouncing in projects like this code which was ported from an AVR chip. The source for both is available if you wanted to compare how the two differ.
Interrupts are powerful. Learn them, love them, use them.
love all the ‘n00b concept’ posts.. seriously.. it makes the HAD grow. thanks!
Good post.
I’m sure a lot of us who work with AVRs already know this, but that’s probably why it’s labelled “beginner concepts”.
In any case, it’s a whole lot more relevant than those terribad C# and Java/Android applications development tutorials were (the latter didn’t so much as mention the NDK, which is what HaD should be most interested in!).
This is precisely what the programming tutorials should be.
nice title nice post
Is terribad a new word? Love it. Might start using it!
Interrupts – they do what it says on the tin.
You don’t want to interrupts so much and that long though. It’s great if you have DMA with it.
I could only write 60KB/s from network to an SD card using interrupts and SPI, which is like w00t. But at least it doesn’t block the main program.
“Interrupts are powerful. Learn them, love them, use them.” – Awesome line!! Wish it was on a t-shirt, lol!!
It is not ProtoShack.. it is ProtoStack :)
So, is this taking the place of the C# development tutorial for this week? I was looking forward to that.
big fan of these beginner concepts post. Keep them coming HAD