Interrupt Function
A single microcontroller can serve several devices. There are two methods by which devices receive service from the microcontroller: interrupt functions or polling. In polling, the microcontroller continuously monitors the status of a given device; when the status condition is met, it performs the service. After that, it moves on to monitor the next device until each one is serviced. In the interrupt function method, whenever any device needs the microcontroller’s service, the device notifies it by sending an interrupt function signal. Upon receiving an interrupt function signal, the microcontroller stops whatever it is doing and serves the device. The program associated with the interrupt function is called the interrupt function service routine (ISR).
The first thing the microcontroller does when an interrupt function request arrives is to execute the current instruction and then stops the regular program execution. As a result, the current program memory address is automatically pushed onto the stack and the default address (predefined by the manufacturer) is written to the program counter. The location from where the program proceeds with execution are called an interrupt function vector.
Enabling and Disabling an Interrupt Function
All interrupt functions are disabled by default, meaning that none will be responded to by the microcontroller if they are activated. The interrupt functions must be enabled by software for the microcontroller to respond to them. The INTCON register is responsible for enabling and disabling the interrupt functions.
Project: How To Enable External Interrupt Function
In this project, we will enable the external interrupt function and we will turn On and Off the LED that is connected with RD0 pin of the PIC16F877 microcontroller, and the microcontroller operated with an 8MHz crystal. We will use the RB0 pin of the microcontroller that is an external interrupt function pin and we are using the switch as the input device that will trigger the interrupt function signal.
Facebook Page / star-technology-5g-114217917006898
Twitter / startechnolog18
Blogger https://www.blogger.com/blog/posts/34...
Tumblr / startechnology5g
Pinterest / startechnology5g
Linkedin / star-technology-5g-0779661b2
reddit / startechnology5g
#microcontroller #clanguage #clanguageprogramming #electronicscreators #microcontroller_lab
MIX https://mix.com/startechnology5g