Microcontroller
Microcontroller
specific tasks of embedded systems like displaying microwave’s information, receiving remote
signals, etc.
The general microcontroller consists of the processor, the memory (RAM, ROM, EPROM),
Serial ports, peripherals (timers, counters), etc.
Microcontroller Microprocessor
Microcontrollers are used to execute a single Microprocessors are used for big
task within an application. applications.
Its designing and hardware cost is low. Its designing and hardware cost is high.
It is built with CMOS technology, which Its power consumption is high because it
requires less power to operate. has to control the entire system.
It consists of CPU, RAM, ROM, I/O ports. It doesn’t consist of RAM, ROM, I/O ports. It
uses its pins to interface to peripheral
devices.
Types of Microcontrollers
Microcontrollers are divided into various categories based on memory, architecture, bits and
instruction sets. Following is the list of their types −
Bit
Based on bit configuration, the microcontroller is further divided into three categories.
8-bit microcontroller − This type of microcontroller is used to execute arithmetic and
logical operations like addition, subtraction, multiplication division, etc. For example, Intel
8031 and 8051 are 8 bits microcontroller.
16-bit microcontroller − This type of microcontroller is used to perform arithmetic and
logical operations where higher accuracy and performance is required. For example,
Intel 8096 is a 16-bit microcontroller.
32-bit microcontroller − This type of microcontroller is generally used in automatically
controlled appliances like automatic operational machines, medical appliances, etc.
Memory
Based on the memory configuration, the microcontroller is further divided into two categories.
External memory microcontroller − This type of microcontroller is designed in such a
way that they do not have a program memory on the chip. Hence, it is named as
external memory microcontroller. For example: Intel 8031 microcontroller.
Embedded memory microcontroller − This type of microcontroller
ontroller is designed in such
a way that the microcontroller has all programs and data memory, counters and timers,
interrupts, I/O ports are embedded on the chip. For example: Intel 8051 microcontroller.
Instruction Set
Based on the instruction set config
configuration,
uration, the microcontroller is further divided into two
categories.
CISC − CISC stands for complex instruction set computer. It allows the user to insert a
single instruction as an alternative to many simple instructions.
RISC − RISC stands for Reduced In Instruction
struction Set Computers. It reduces the operational
time by shortening the clock cycle per instruction.
Applications of Microcontrollers
Microcontrollers are widely used in various different devices such as −
Light sensing and controlling devices like LED.
Temperature sensing and controlling devices like microwave oven, chimneys.
Fire detection and safety devices like Fire alarm.
Measuring devices like Volt Meter.
The pin diagram of 8051 microcontroller looks as follows −
8253 8254
Reads and writes of the same counter cannot Reads and writes of the same counter can
be interleaved. be interleaved.
Features of 8253 / 54
The most prominent features of 8253/54 are as follows −
It has three independent 16-bit down counters.
It can handle inputs from DC to 10 MHz.
These three counters can be programmed for either binary or BCD count.
It is compatible with almost all microprocessors.
8254 has a powerful command called READ BACK command, which allows the user to
check the count value, the programmed mode, the current mode, and the current status
of the counter.
8254 Architecture
The architecture of 8254 looks as follows −
8254 Pin Description
Here is the pin diagram of 8254 −
Read/Write Logic
It includes 5 signals, i.e. RD, WR, CS, and the address lines A0 & A1. In the peripheral I/O
mode, the RD and WR signals are connected to IOR and IOW, respectively. In the
memorymapped I/O mode, these are connected to MEMR and MEMW.
Address lines A0 & A1 of the CPU are connected to lines A0 and A1 of the 8253/54, and CS is
tied to a decoded address. The control word register and counters are selected according to
the signals on lines A0 & A1.
A1 A0 Result
0 0 Counter 0
0 1 Counter 1
1 0 Counter 2
X X No Selection
Control Word Register
This register is accessed when lines A0 & A1 are at logic 1. It is used to write a command word,
which specifies the counter to be used, its mode, and either a read or write operation.
Following table shows the result for various control inputs.
A1 A0 RD WR CS Result
0 0 1 0 0 Write Counter 0
0 1 1 0 0 Write Counter 1
1 0 1 0 0 Write Counter 2
0 0 0 1 0 Read Counter 0
0 1 0 1 0 Read Counter 1
1 0 0 1 0 Read Counter 2
1 1 0 1 0 No operation
X X 1 1 0 No operation
X X X X 1 No operation
Counters
Each counter consists of a single, 16 bit-down counter, which can be operated in either binary
or BCD. Its input and output is configured by the selection of modes stored in the control word
register. The programmer can read the contents of any of the three counters without disturbing
the actual count in process.
8253/54 can be operated in 6 different modes. In this chapter, we will discuss these
operational modes.
Data Bus Buffer This block is used to communicate between 8259 and 8085/8086
by acting as buffer. It takes the control word from 8085/8086 and
send it to the 8259. It transfers the opcode of the selected
interrupts and address of ISR to the other connected
microprocessor. It can send maximum 8-bit at a time.
R/W Control Logic This block works when the value of pin CS is 0. This block is used
to flow the data depending upon the inputs of RD and WR. These
are active low pins for read and write.
Control Logic It controls the functionality of each block. It has pin called INTR.
This is connected to other microprocessors for taking the interrupt
request. The INT pin is used to give the output. If 8259 is enabled,
and also the interrupt flags of other microprocessors are high then
this causes the value of the output INT pin high, and in this way
this chip can responds requests made by other microprocessors.
Interrupt Request It stores all interrupt level that are requesting for interrupt service.
Register
Interrupt Service It stores interrupt level that are currently being execute.
Register
Interrupt Mask It stores interrupt level that will be masked, by storing the masking
Register bits of interrupt level.
Priority Resolver It checks all three registers, and set the priority of the interrupts.
Interrupt with the highest priority is set in the ISR register. It also
reset the interrupt level which is already been serviced in the IRR.
Cascade Buffer To increase number of interrupt pin, we can cascade more number
of pins, by using cascade buffer. When we are going to increase
the interrupt capability, CSA lines are used to control multiple
interrupts.