![]() ![]() Imagine you’re sitting on your couch, enjoying a frosty brew and watching a movie after a long day. ![]() This means that rather than manually checking whether your desired event has happened, you can let your AVR do the checking for you. An asynchronous event is something that occurs outside of the regular flow of your program – it can happen at any time, no matter what your code is crunching on at the moment. ![]() You certainly can do all of these things in your main code, but interrupts give you a key advantage – they are asynchronous. After all, you can check the state of external pins at any time, or create your own timers. If you’re new to the world of software development, you might wonder why all this complication is necessary just to respond to external events. Once the function is completed, the program returns to what it was doing before the interrupt was triggered. This function is called an interrupt handler or an interrupt service routine (ISR). ![]() Once triggered, an interrupt pauses the current activity and causes the program to execute a different function. It may be triggered by an external event (change in pin state) or an internal event (a timer or a software signal). On a very basic level, an interrupt is an signal that interrupts the current processor activity. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |