Wikipedia
Search results
Wednesday, 31 July 2013
How does the microcontroller operate?
Even though there is a large number of different types of
microcontrollers and even more programs created for their use only, all of them
have many things in common. Thus, if you learn to handle one of them you will
be able to handle them all. A typical scenario on the basis of which it all
functions is as follows:
- Power supply is turned off and everything is still…the program is loaded into the microcontroller, nothing indicates what is about to come…
- Power supply is turned on and everything starts to happen at high speed! The control logic unit keeps everything under control. It disables all other circuits except quartz crystal to operate. While the preparations are in progress, the first milliseconds go by.
- Power supply voltage reaches its maximum and oscillator frequency becomes stable. SFRs are being filled with bits reflecting the state of all circuits within the microcontroller. All pins are configured as inputs. The overall electronis starts operation in rhythm with pulse sequence. From now on the time is measured in micro and nanoseconds.
- Program Counter is set to zero. Instruction from that address is sent to instruction decoder which recognizes it, after which it is executed with immediate effect.
- The value of the Program Counter is incremented by 1 and the whole process is repeated...several million times per second.
What are microontrollers and what are they used for?
Like all good things, this powerful component is basically
very simple. It is made by mixing tested and high- quality
"ingredients" (components) as per following receipt:
- The simplest computer processor is used as the "brain" of the future system.
- Depending on the taste of the manufacturer, a bit of memory, a few A/D converters, timers, input/output lines etc. are added
- All that is placed in some of the standard packages.
- A simple software able to control it all and which everyone can easily learn about has been developed.
On the basis of these rules, numerous types of controllers were designed and they quickly became man's invisible
companion. Their incredible simplicity and flexibility conquered us a long time
ago and if you try to invent something about them, you should know that you are
probably late, someone before you has either done it or at least has tried to
do it.
The following things have had a crucial influence on
development and success of the microcontrollers:
- Powerful and carefully chosen electronics embedded in the microntrollers can independetly or via input/output devices (switches, push buttons, sensors, LCD displays, relays etc.), control various processes and devices such as industrial automation, electric current, temperature, engine performance etc.
- Very low prices enable them to be embedded in such devices in which, until recent time it was not worthwhile to embed anything. Thanks to that, the world is overwhelmed today with cheap automatic devices and various “smart” appliances.
- Prior knowledge is hardly needed for programming. It is sufficient to have a PC (software in use is not demanding at all and is easy to learn) and a simple device (called the programmer) used for “loading” ready-to-use programs into the microcontroller.
So, if you are infected with a virus called electronics,
there is nothing left for you to do but to learn how to use and control its
power.
Tuesday, 16 July 2013
Saturday, 13 July 2013
Advantages and Disadvantages
Advantages of Microcontrollers
a)
Microcontrollers act as a microcomputer without any digital parts.
b) As the higher
integration inside microcontroller reduce cost and size of the system.
c) Usage of
microcontroller is simple, easy for troubleshoot and system maintaining.
d) Most of the
pins are programmable by the user for performing different functions.
e) Easily
interface additional RAM, ROM,I/O ports.
f) Low time
required for performing operations.
Disadvantages of Microcontrollers
a)
Microcontrollers have got more complex architecture than that of
microprocessors.
b) Only perform
limited number of executions simultaneously.
c) Mostly used in
micro-equipments.
d) Cannot
interface high power devices directly.
Microcontroller Structure
CPU
CPU is the brain of a microcontroller .CPU is responsible
for fetching the instruction, decodes it, then finally executed. CPU connects
every part of a microcontroller into a single system. The primary function of
CPU is fetching and decoding instructions. Instruction fetched from program
memory must be decoded by the CPU.
Memory
The function of memory in a microcontroller is same as
microprocessor. It is used to store data and program. A microcontroller usually
has a certain amount of RAM and ROM (EEPROM, EPROM, etc) or flash memories for
storing program source codes.
Parallel input/output ports
Parallel input/output ports are mainly used to
drive/interface various devices such as LCD’S, LED’S, printers, memories, etc
to a microcontroller.
Serial ports
Serial ports provide various serial interfaces between
microcontroller and other peripherals like parallel ports.
Timers/counters
This is the one of the useful function of a microcontroller.
A microcontroller may have more than one timer and counters. The timers and
counters provide all timing and counting functions inside the microcontroller.
The major operations of this section are perform clock functions, modulations,
pulse generations, frequency measuring, making oscillations, etc. This also can
be used for counting external pulses.
Analog to Digital Converter (ADC)
ADC converters are used for converting the analog signal to
digital form. The input signal in this converter should be in analog form (e.g.
sensor output) and the output from this unit is in digital form. The digital
output can be use for various digital applications (e.g. measurement devices).
Digital to Analog Converter (DAC)
DAC perform reversal operation of ADC conversion.DAC convert
the digital signal into analog format. It usually used for controlling analog
devices like DC motors, various drives, etc.
Interrupt control
The interrupt control used for providing interrupt (delay)
for a working program .The interrupt may be external (activated by using
interrupt pin) or internal (by using interrupt instruction during programming).
Special functioning block
Some microcontrollers used only for some special
applications (e.g. space systems and robotics) these controllers containing
additional ports to perform such special operations. This considered as special
functioning block.
Basic of Microcontroller
1) A microcontroller basically contains one or more
following components:
- Central processing unit(CPU)
- Random Access Memory)(RAM)
- Read Only Memory(ROM)
- Input/output ports
- Timers and Counters
- Interrupt Controls
- Analog to digital converters
- Digital analog converters
- Serial interfacing ports
- Oscillatory circuits
2) A microcontroller internally consists of all features
required for a computing system and functions as a computer without adding any
external digital parts in it.
3) Most of the pins in the microcontroller chip can be made
programmable by the user.
4) A microcontroller has many bit handling instructions that
can be easily understood by the programmer.
5) A microcontroller is capable of handling Boolean
functions.
6) Higher speed and performance.
7) On-chip ROM structure in a microcontroller provides
better firmware security.
8 ) Easy to design with low cost and small size.
Applications
Microcontrollers are widely used in modern electronics
equipments. Some basic applications of microcontroller is given below.
- Used in biomedical instruments.
- Widely used in communication systems.
- Used as peripheral controller in PC.
- Used in robotics.
- Used in automobile fields
Different Microprocessor and Microcontroller
Microprocessor is an IC which has only the CPU inside them
i.e. only the processing powers such as Intel’s Pentium 1,2,3,4, core 2 duo,
i3, i5 etc. These microprocessors don’t have RAM, ROM, and other peripheral on
the chip. A system designer has to add them externally to make them functional.
Application of microprocessor includes Desktop PC’s, Laptops, notepads etc.
But this is not the case with Microcontrollers.
Microcontroller has a CPU, in addition with a fixed amount of RAM, ROM and
other peripherals all embedded on a single chip.
At times it is also termed as
a mini computer or a computer on a single chip. Today different manufacturers
produce microcontrollers with a wide range of features available in different
versions. Some manufacturers are ATMEL, Microchip, TI, Freescale, Philips,
Motorola etc.
Microcontrollers are designed to perform specific tasks.
Specific means applications where the relationship of input and output is
defined. Depending on the input, some processing needs to be done and output is
delivered. For example, keyboards, mouse, washing machine, digicam, pendrive,
remote, microwave, cars, bikes, telephone, mobiles, watches, etc. Since the
applications are very specific, they need small resources like RAM, ROM, I/O
ports etc and hence can be embedded on a single chip. This in turn reduces the
size and the cost.
Microprocessor find applications where tasks are unspecific
like developing software, games, websites, photo editing, creating documents
etc. In such cases the relationship between input and output is not defined.
They need high amount of resources like RAM, ROM, I/O ports etc.
The clock speed of the Microprocessor is quite high as
compared to the microcontroller. Whereas the microcontrollers operate from a
few MHz to 30 to 50 MHz, today’s microprocessor operate above 1GHz as they
perform complex tasks .
Comparing microcontroller and microprocessor in
terms of cost is not justified. Undoubtedly a microcontroller is far cheaper
than a microprocessor. However microcontroller cannot be used in place of
microprocessor and using a microprocessor is not advised in place of a
microcontroller as it makes the application quite costly. Microprocessor cannot
be used stand alone. They need other peripherals like RAM, ROM, buffer, I/O
ports etc and hence a system designed around a microprocessor is quite costly.
Comparison between Microprocessor and Microcontroller
Friday, 12 July 2013
Microcontroller
Introduction
Microcontrollers are hidden inside a surprising number of products these days. If your microwave oven has an LED or LCD screen and a keypad, it contains a microcontroller. All modern automobiles contain at least one microcontroller, and can have as many as six or seven: The engine is controlled by a microcontroller, as are the anti-lock brakes, the cruise control and so on.
Any device that has a remote control almost certainly contains a microcontroller : TVs, VCRs and high-end stereo systems all fall into this category. Nice SLR and digital cameras, cell phones, camcorders, answering machines, laser printers, telephones (the ones with caller ID, 20-number memory, etc.), pagers, and feature-laden refrigerators, dishwashers, washers and dryers (the ones with displays and keypads).
A microcontroller is a
computer. All computers whether we are talking about a personal desktop
computer or a large mainframe computer or a microcontroller have a several
things in common :
- All computers have a CPU (central processing unit) that executes programs. If you are sitting at a desktop computer right now reading this article, the CPU in that machine is executing a program that implements the Web browser that is displaying this page.
- The CPU loads the program from somewhere. On your desktop machine, the browser program is loaded from the hard disk.
- The computer has some RAM (random-access memory) where it can store "variables."
- And the computer has some input and output devices so it can talk to people. On your desktop machine, the keyboard and mouse are input devices and the monitor and printer are output devices. A hard disk is an I/O device. It handles both input and output .
Application of Microprocessor
Example 1: LEDs
Example : Use the 8085 to turn on LEDs. The 8085 should be
connected to eight LEDs at address 01H and the program should turn on LEDs 6,7 and 8
Solution : The 8-bit data lines are connected to the LEDs through
an output latch addressed at 01H.
BUS system
Data Bus
- As name tells that it is used to transfer data within Microprocessor and Memory/Input or Output devices. It is bidirectional as Microprocessor requires to send or receive data.
- The data bus also works as address bus when multiplexed with lower order address bus. Data bus is 8 Bits long.
- The word length of a processor depends on data bus, that why Intel 8085 is called 8 bit Microprocessor because it have an 8 bit data bus.
Address Bus
- It is a group of wires or lines that are used to transfer the addresses of Memory or I/O devices. It is without direction .
- In Intel 8085 microprocessor, Address bus was of 16 bits. This means that Microprocessor 8085 can transfer maximum 16 bit address which means it can address 65,536 different memory locations.
Control Bus
Microprocessor uses control bus to process data, that is
what to do with the selected memory location.
Some control signals are Read, Write and Operation code
fetch. Various operations are performed by microprocessor with the help of
control bus. This is a dedicated bus, because all timing signals are generated
according to control signal.
Microprocessor Organization
ALU(Arithmetic Logic
Unit)
- The part of a computer that performs all arithmetic computations, such as addition and multiplication, and all comparison operations. The ALU is one component of the CPU (central processing unit).
- To perform simple addition, subtraction, multiplication, division, and logic operation
Control Unit
- Control unit is circuitry that directs operations within the computer's processor by directing the input and output of a computer system.
- A control unit works by gathering input through a series of commands it receives from instructions in a running programs and then outputs those commands into control signals that the computer and other hardware attached to the computer carry out.
- Example below :
Register
- A processor register is a local storage space on a processor that holds data that is being processed by CPU.
- Processor has a local storage area known as a register that performs most of the operations that the processor cannot perform directly.Any kind of data must first be identified by the register before it can be manipulated by the processor.
Accumulator
Accumulator is a AL register in which intermediate
arithmetic and logic results are stored.Without a register like an accumulator, it would be
necessary to write the result of each calculation (addition, multiplication,
shift, etc.) to main memory, perhaps only to be read right back again for use
in the next operation.
Condition Code
Register
- Contains flags set by the processor during the execution of instructions.Consists of individual bits are set or clear depending on the result of an operation. These bits can remember processing states between instruction.
- Different instruction affect the condition register in different way. Depend on processor type , a data , transfer instruction may not affect any flag , while an addition may affect several flag
Program Counter
- The Program Counter (PC) is a register structure that contains the address pointer value of the current instruction. Each cycle, the value at the pointer is read into the instruction decoder and the program counter is updated to point to the next instruction
- Programmers do not have direct control over the program counter like they do with other registers. The program counter indicates where the CPU is in its current instruction sequence.
Stack Pointer
- The stack pointer is used to make sub-routines possible. By always pointing to the last used memory location, a push command can be used to add onto the stack and a pull to retrieve the last operation.
- Therefore, before executing a set of instructions, the current address can be pushed to the stack and at the end of the execution of the set of instructions, the address can be pulled from the stack making it possible to return to the previous location.
- The stack pointer must be initialized before it can be used.
Tuesday, 2 July 2013
Evolution Of Microprocessor
1.1
DATA SIZE : NIBBLE, BYTE, WORD, LONG WORD.
The
capacity of a microprocessor is normally referred to how many bits of data can
be handled at one time, or what is the memory size (the amount of data cells of
memory, determined by the amount of address lines/bits) accessible by the
system. Thus it is important to have a
great understanding about data size.
Data
size is a mean of measure to determine how much data can be stored in a single
cell of memory. Imagine you are looking
at the post boxes at a post office. Each
box can store a certain amount of letter (assumed all letters have equal
size). The size of each post box the
greater numbers of letter can be stored.
Similarly in memory storage, a memory storage can be distributed into
many single cell with equal data size.
In digital form, the smallest size of a single cell is called 1 bit.
If a single cell can store 4 bit of
data, the cell size is called Nibble. Subsequently 8 bits is called Byte, 16 bits is Word and 32 is Long Word.
A
single cell sized 1 bit can store either logic 0 or logic 1. In other word, two different situations can
be stored or represented. Thus the range
of data is 0-1.
Data
size : n = 1
Data
capacity : 2n = 21 = 2
Range
: 0 - 1
A single cell sized 4 bit (Nibble) can store 16 possible situations.
A single cell sized 4 bit (Nibble) can store 16 possible situations.
Data
size : n = 4
Data
capacity : 2n = 24 = 16
Range
: 0 - 15
Figure
above shows the different data sizes in a graphic manner. Please note that the data size is determined
by the number of bit (n), and is label from 0 to n-1. For the data type Byte, Word and Long Word
allocate the MSB as the sign bit, to determine that value of remaining bits is
positive or negative.
For
the data which has more bits, it is easier to divide it into dual-half portions
i.e. upper (MSB section) and lower portions (LSB section).
ü
1
Byte consists of two nibbles, upper nibble and lower nibble.
ü
1
Word consists of two bytes, upper byte and lower byte.
ü
1
Long Word consists of two word, upper word and lower word.
Basic Computer System
A computer has the
following units:
·
Input Unit
·
Output Unit
·
Memory Unit
·
Central Processing Unit
![]() |
Block Diagram |
1. Input:
This is the process of entering data and programs in to the computer system.
You should know that computer is an electronic machine like any other machine
which takes as inputs raw data and performs some processing giving out
processed data. Therefore, the input unit takes data from us to the computer in
an organized manner for processing.
2. Storage:
The process of saving data and instructions permanently is known as storage.
Data has to be fed into the system before the actual processing starts. It is
because the processing speed of Central Processing Unit (CPU) is so fast that
the data has to be provided to CPU with the same speed. Therefore the data is
first stored in the storage unit for faster access and processing. This storage
unit or the primary storage of the computer system is designed to do the above
functionality. It provides space for storing data and instructions.
The storage unit performs the
following major functions:
• All data and instructions are
stored here before and after processing.
• Intermediate results of
processing are also stored here.
3. Processing:
The task of performing operations like arithmetic and logical operations is
called processing. The Central Processing Unit (CPU) takes data and
instructions from the storage unit and makes all sorts of calculations based on
the instructions given and the type of data provided. It is then sent back to
the storage unit.
4. Output:
This is the process of producing results from the data for getting useful
information. Similarly the output produced by the computer after processing
must also be kept somewhere inside the computer before being given to you in
human readable form. Again the output is also stored inside the computer for
further processing.
5. Control:
The manner how instructions are executed and the above operations are
performed. Controlling of all operations like input, processing and output are
performed by control unit. It takes care of step by step processing of all
operations inside the computer.
FUNCTIONAL UNITS
In order to carry out the
operations mentioned in the previous section the computer allocates the task
between its various functional units. The computer system is divided into three
separate units for its operation. They are
1) arithmetic logical unit
2) control unit.
3) central processing unit.
Arithmetic Logical Unit
(ALU) Logical Unit
Logical Unit
: After you enter data through the input device it is stored in the primary
storage unit. The actual processing of the data and instruction are performed
by Arithmetic Logical Unit. The major operations performed by the ALU are
addition, subtraction, multiplication, division, logic and comparison. Data is
transferred to ALU from storage unit when required. After processing the output
is returned back to storage unit for further processing or getting stored.
Control Unit (CU)
The next component of computer
is the Control Unit, which acts like the supervisor seeing that things are done
in proper fashion. Control Unit is responsible
for coordinating various
operations using time signal. The control unit determines the sequence in which
computer programs and instructions are executed. Things like processing of
programs stored in the main memory, interpretation of the instructions and
issuing of signals for other units of the computer to execute them. It also
acts as a switch board operator when several users access the computer
simultaneously. Thereby it coordinates the activities of computer’s peripheral
equipment as they perform the input and output.
Central Processing
Unit (CPU)
The ALU and the CU of a computer
system are jointly known as the central processing unit. You may call CPU as
the brain of any computer system. It is just like brain that takes all major
decisions, makes all sorts of calculations and directs different parts of the
computer functions by activating and controlling the operations.
MICROCOMPUTER SYSTEM
We already learned that in a
basic computer system, a Central Processing Unit (CPU) consists of both ALU and
Control Units. In a microcomputer the
CPU is usually implemented on a single chip, which is the microprocessor. Some system may need several additional chips
to be connected to a microprocessor chip to make the CPU. It is common to refer to the microprocessor
as the MPU (microprocessor unit), since it is the CPU of the microcomputer.
·
Since microcomputer system is
actually a basic computer system, the main elements of the internal constructions
and function are similar. However, the
following outlines some important features in mode specific manner of a
microcomputer system as a comparison to the basic computer system.
a) CPU (Central
Processing Unit)
·
A silicon chip that works as
‘heart’ of the computer.
·
Receive instructions from memory
to implement a task.
b) Memory Unit.
·
Store data and programs.
·
Divided into two (2) main
categories:
1) Primary Memory:
ROM (Read Only Memory)
·
Data can only be read but cannot
be written into it.
·
The stored data will not
disappear when the power supply is disconnected.
2. Secondary Memory:
·
RAM can only keep data in
temporary basis, thus we need a permanent storage, which is also called secondary storage.
·
The example of secondary storage
are floppy disc and hard disk. Another
type is CDROM (Compact-disc ROM), which can store up to 600 million characters
and it is suitable for storing huge size of information.
C) Input/Output (I/O)
Unit
·
I/O unit contains the interface
circuits needed to allow the peripheral to proper communicate with the rest of
the computer.
·
In some cases these interface circuits are LSI
chips designed by the MPU manufacturer to interface the MPU to a variety of I/O
devices. In other cases the interface
circuits may be as simple as buffer register.
·
I/O unit allows user (external
environment) to communicate with the computer system via interface unit that
connected to the peripheral devices. The
peripheral devices such as keyboard, printer, sensor that measuring vehicle
speed etc.
·
The port size of I/O unit is
equivalent to the data bus size of the microprocessor.
Introduction
A microprocessor incorporates the functions of a computer's
central processing unit (CPU) on a single integrated circuit (IC) or at most a
few integrated circuits. It is a multipurpose, programmable device that accepts
digital data as input, processes it according to instructions stored in its
memory, and provides results as output. It is an example of sequential digital
logic, as it has internal memory. Microprocessors operate on numbers and
symbols represented in the binary numeral system.
Subscribe to:
Posts (Atom)