This project demonstrates using the external interrupt (INT) of the PIC16F877A.
When a push button connected to RB0 is pressed, an interrupt is triggered, toggling an LED or output connected to RC0.
- PIC16F877A Microcontroller
- LED (any color)
- Push Button
- 1kΩ Resistor (for pull-down if needed)
- Breadboard / Proteus simulation board
- Connecting wires
- MPLAB X IDE
- XC8 Compiler (C99 or later)
- Proteus 8 Professional (for simulation)
🧩 Proteus Circuit Setup
Controller: PIC16F877A
Oscillator: 20 MHz Crystal (pins 13 & 14)
Input Button: Connect to RB0 with pull-down resistor
LED: Connect anode to RC0 through 330Ω resistor, cathode to GND
Power: +5V to VDD, GND to VSS
Open Proteus_Design.pdsprj in Proteus 8.
Load the compiled .hex file from MPLAB X.
Run simulation — pressing the button toggles the LED at RC0.
📸 Output Button Pressed → LED toggles ON/OFF
🧰 Future Expansion Ideas
Connect multiple buttons to trigger different interrupts.
Count the number of interrupts and display on LCD.
Trigger relays or motors using external interrupts for event-driven control.