Sitting in a loop while waiting for something to happen (in this case, polling the RAIF flag) isn't really what interrupts are about.
To be really useful, it should actually interrupt whatever your program is currently doing when RA0 changes state. For example, let's say you have a routine the is blinking PORTC.5 at a slow rate of 500mS ON and 500mS OFF continuously in a loop. If the state of RA0 changes (eg. by using a switch or sensor), then you want the blink rate to go faster rate, say 100ms ON and 100ms OFF.
Bookmarks