Skip to content

PIC18 interrupts

Practical guide unit

PIC18 interrupts

Intermediate

Step-by-step guide: from polling to a Timer0 ISR that blinks an LED without blocking the main loop — one verifiable action per step.

You will build

A `.ASM` with **interrupt vectors**, **16-bit Timer0**, and an **ISR** that toggles the **LED on RB0** every ~2 s while main code sits in an empty loop.

Recommended first: puertos

  1. 1 Welcome: polling vs interrupts
  2. 2 Create project and .ASM file
  3. 3 LIST, CONFIG, and interrupt vectors
  4. 4 RAM variables and LED GPIO
  5. 5 Configure Timer0 (no ISR yet)
  6. 6 Enable interrupts (GIE and TMR0IE)
  7. 7 Minimal ISR: check flag and clear
  8. 8 Save and restore context
  9. 9 Full ISR: toggle LED and reload Timer0
  10. 10 Preview: RB4–RB7 interrupt (keyboard)
  11. 11 Check what you learned

Start step 1 →