Chapter 10

Interrupts

If we are carrying out a task and we are interrupted by the phone ringing. We answer the phone, deal with it, and then return to our task. We need to remember of course what position we were at in the task. We could have been interrupted by a knock on the door.

The microcontroller does a similar thing when handling an interrupt. The microcontroller stops the task it is on and deals with the interrupt routine. It remembers where it was and returns back to the task.

There are several ways a microcontroller like the 18F1220 can be interrupted and they are:

ent RB0 going high or RB0 going low.

 RB1 going high or RB1 going low.

Get PIC Projects and Applications using C now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.