INTERRUPT To Power Supply
INTERRUPT To Power Supply
Most programs use interrupts in their regular execution. The purpose of the microcontroller is
mainly to respond to changes in its surrounding. In other words, when an event takes place, the
microcontroller does something... For example, when you push a button on a remote controller, the
microcontroller will register it and respond by changing a channel, turn the volume up or down etc.
If the microcontroller spent most of its time endlessly checking a few buttons for hours or days, it
would not be practical at all.
This is why the microcontroller has learnt a trick during its evolution. Instead of checking each pin or
bit constantly, the microcontroller delegates the ‘wait issue' to a ‘specialist' which will respond only
when something attention worthy happens.
The signal which informs the central processor unit about such an event is called an INTERRUPT.
Instruction Decoder is a part of electronics which decodes program instructions and runs other
circuits on the basis of that. The ‘instruction set' which is different for each microcontroller family
expresses the abilities of this circuit;
Arithmetical Logical Unit (ALU) performs all mathematical and logical operations upon data; and
Accumulator is an SFR closely related to the operation of the ALU. It is a kind of working desk used
for storing all data upon which some operation should be performed (addition, shift/move etc.). It
also stores results ready for use in further processing. One of the SFRs, called a Status Register
(PSW), is closely related to the accumulator. It shows at any given time the ‘status' of a number
stored in the accumulator (number is larger or less than zero etc.). Accumulator is also called
working register and is marked as W register or just W, therefore.
BUS
A bus consists of 8, 16 or more wires. There are two types of buses: the address bus and the data
bus. The address bus consists of as many lines as necessary for memory addressing. It is used to
transmit address from the CPU to the memory. The data bus is as wide as the data, in our case it is 8
bits or wires wide. It is used to connect all the circuits within the microcontroller.
POWER SUPPLY CIRCUIT
There are two things worth attention concerning the microcontroller power supply circuit:
Brown out is a potentially dangerous condition which occurs at the moment the microcontroller is
being turned off or when the power supply voltage drops to a minimum due to electric noise. As the
microcontroller consists of several circuits with different operating voltage levels, this state can
cause its out-of-control performance. 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 a 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.