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 live online training, plus books, videos, and digital content from nearly 200 publishers.