INTERRUPT To Power Supply
INTERRUPT To Power Supply
INTERRUPT
An interrupt is an event that makes the microprocessor to temporarily suspend its regular
execution. Later it returns to its original execution task. Most programs use interrupts in their
regular execution. The purpose of the microcontroller is mainly to respond to changes in its
surroundings. For example, when you push a button on a remote controller, the
microcontroller stops its normal operation and take this as interrupt and respond by changing
a channel, turn the volume up or down, etc. Another example is when a computer systems use
interrupt driven I/O, a process where pressing a key on the keyboard or clicking a button on
the mouse triggers an interrupt. So it is very different for a microcontroller to monitor the
event that is triggered often. It takes time and not impractical.
One method to solve this issue is Interrupt Service Routine (ISR). In this, Microcontroller
need not run a set of programs or check a pin to monitor the triggers or events. Instead, it will
respond only when an interrupt happens. The signal which informs the Central Processor Unit
(CPU) about such an event is called an INTERRUPT. The program that runs after interrupt is
said to be interrupt service routine. The following steps will happen in a microcontroller
when an interrupt occurs.
1. When an interrupt event request for the control, the CPU stores its current address
(from program counter) and status into a memory location and loads the interrupt
routine address in the Program Counter(PC).
2. Once the Program Counter (PC) is loaded with the address the control will change and
starts to run the interrupt service routine.
3. Once the Interrupt program ends the program counter is again loaded with the normal
routine address to continue the normal execution.
4. By doing the above three steps any of the interrupt can be served by the
microcontroller.
As its name suggests, this is a unit which monitors and controls all processes within the
microcontroller. It consists of several subunits, of which the most important are:
1. Instruction decoder:
Instruction decoder takes bits stored in the instruction register and decodes it and tells
the CPU what it has to do and enable the components for the operation. Simply,
instruction decoder is like a dictionary. It tells the meaning of the instruction and
commands all the components.
BUS
A CPU can communicate with the memory and other peripherals through two buses. One is
address bus and the other is data bus. A bus consists of 8, 16 or more wires. The address bus
‘tells’ the memory (or the peripherals) wherein the memory data should be read or written.
Data is typically stored in consecutive blocks, which can be sub-divided into individual
words. A word is typically 8 bits (= 1 Byte), 16 bits, or 32 bits wide. The index of the array is
called the address of the respective word. To read data from the memory, one has to apply the
correct address through the address bus. The memory then presents the correct word on the
data bus. Writing to the memory is similar: First assert the address at which you would like to
store the data, and then write the data to the data bus.
The hardware automatically applies the specified address and reads or writes the data from/to
the data bus.
Brown out is a potentially dangerous condition which occurs at many different times such as
inadequate power regulation, system components turning on or off, system malfunctions, etc.
Unfortunately, brown-out conditions often don’t show up in the system development stage,
but wait until the production run begins with all the system components installed to show
their ugly heads. In order to prevent it, the microcontroller usually has a built-in circuit for
brown out reset which resets the whole electronics as soon as the microcontroller incurs a
state of emergency.
Reset pin is usually marked as MCLR (Master Clear Reset). It is used for external reset of the
microcontroller by applying logic zero (0) or one (1) to it, which depends on the type of the
microcontroller. In case the brown out circuit is not built in, a simple external circuit for
brown out reset can be connected to the MCLR pin.
Another problem is Black-outs takes place when the power supply goes to OFF state. In this
scenario the process is completely shut down so no recover can be done, since the voltage
drop all of a sudden.