Introduction

  • PIC18F4550 and interrupts
  • External interrupt (INT0, INT1, INT2)
  • RB port change interrupt (RB4~RB7)
  • Example

(30 minutes)


PIC18F4550 and interrupts

What do we mean by Interrupt in microcontrollers?

Interrupt is the cessation of running the main program of the microcontroller in order to execute a program from the interrupt service routine.



A signal causes the main program to stop running during command “n” in order to execute the interrupt service routine. When the interrupt routine is finished, the next command of the main program is executed, ie the command “n + 1”.


What is an interrupt signal?

  • The interrupt signal may be a state change to an external pin of the microcontroller used. In this case the interrupt is called an external interrupt because a signal from the outside world changes the execution flow of the program in order to execute the interrupt service routine
  • The interrupt signal may come from inside the microcontroller, for example from one of the microcontroller timers. In this case the interrupt is called internal interrupt because a signal from inside the microcontroller changes the program execution flow in order to execute the interrupt service routine