UNIT-I MICRO CONTROLLER & INTERFACING NOTES
VI semester
paper -VII
Title: Micro
controllers and interfacing
Unit-1 : Introduction to
Microcontroller:
What
is a Microcontroller?
A
microcontroller is a small, low-cost and self contained computer-on-a-chip that
can be used as an embedded system. (Or) A microcontroller is a self-contained system
with peripherals, memory and a processor that can be used as an embedded
system.
Most programmable microcontrollers are used as
embedded in other consumer products or machinery and household appliances for
computer systems. Due to that, another name for a microcontroller is
"embedded controller."
The
basic structure of a microcontroller :-
1.
CPU – CPU is brain of the
Microcontroller. CPU used to fetch data, decode it and complete the task successfully. With the help
of CPU all the components of microcontroller is connected into a single system.
Instruction fetched by the programmable memory is decoded by the CPU.
2.
Memory – In a
microcontroller memory chip works same as microprocessor. Memory chip stores all programs & data.
Microcontrollers are built with certain amount of ROM or RAM (EPROM, EEPROM,
etc) or flash memory for the storage of program source codes.
3.
Input/output ports – I/O ports
are basically employed to interface or drive different appliances such as-
printers, LCD’s, LED’s, etc.
4.
Serial Ports – These
ports give serial interfaces to microcontroller & various other peripherals
such as parallel port.
5.
Timers – A
microcontroller may be in-built with one or more timer or counters. The timers
& counters control all counting & timing operations within a
microcontroller. Timers are employed to count external pulses. The main
operations performed by timers’ are- pulse generations, clock functions,
frequency measuring, modulations, making oscillations, etc.
6.
ADC (Analog to digital converter) – ADC is employed to convert analog signals to digital
ones. The input signals need to be analog for ADC. The digital signal
production can be employed for different digital applications (such as-
measurement gadgets).
7.
DAC (digital to analog converter) – this converter executes opposite functions that ADC
perform. This device is generally employed to supervise analog appliances like-
DC motors, etc.
8.
Interpret Control- This
controller is employed for giving delayed control for a working program. The
interpret can be internal or external.
9.
Special Functioning Block – Some special microcontrollers manufactured for special
appliances like- space systems, robots, etc, comprise of this special function
block. This special block has additional ports so as to carry out some special
operations.
**Evolution of microcontrollers from 4 bit to 32 bit.
Intel first
produced a microcontroller in 1976 is MCS-48, it
is an 8 bit microcontroller.
Later in 1980 they released a further improved version (which is also 8 bit),
MCS-51. The most popular microcontroller 8051 belongs to the MCS-51 family of
microcontrollers by Intel.
Global
companies in semiconductor industry like Microchip,
Zilog, Atmel, Philips, Siemens released products under their brand
name.
A 4
bit microcontroller is used for a toys and clock frequencies. After that intel
developed
·
8
bit Microcontrollers
·
16
bit Digital Signal Controllers (DSC)
·
16
bit General Purpose Microcontrollers
·
32
bit Micorcontrollers
Intel developed 8051 is one of the most popular 8 bit micro
controller it contains an instruction set with enough power and a large enough
program space by use with C Language.
the 16 and 32 bit microprocessors
has sophisticated control capability
& larger word widths and address spaces.
The development of microcontrollers has focused upon the integration of
the facilities needed to support fast control into a single chip.
Intel has introduced standard 8-bit microcontroller 8048 in 1976. The same company has continued to drive the evolution of single chip microcontrollers.
Intel has introduced standard 8-bit microcontroller 8048 in 1976. The same company has continued to drive the evolution of single chip microcontrollers.
In the year 1980, Intel has
introduced the 8051 microcontroller, with higher performance than 8048. With
the advantages of 8051. The 8-bit microcontroller, 8051 family are the second
generation world standard microcontrollers.
In the advanced semiconductor technology, it is possible to integrate more than 1.00.000 transistors on a single silicon chip. Intel has made use of this advanced process technology and developed a new generation of single chip 16 bit microcontrollers called the MCS-96 (8096 family).
In the advanced semiconductor technology, it is possible to integrate more than 1.00.000 transistors on a single silicon chip. Intel has made use of this advanced process technology and developed a new generation of single chip 16 bit microcontrollers called the MCS-96 (8096 family).
The 8096 family offers the highest level of system integration on a
single chip microcontroller with l,20,000 transistors. This 8096
microcontroller has 16 bit CPU, 8K bytes of program memory. 232 bytes of data
memory and both analog and digital type of 1/ O features.
The Motorola Microcontroller family was first introduced in 1978 and is built in the same pattern of the microprocessor 6800. The Microcontroller 6801 family was designed similar as the microprocessor 6800, its design and instruction set modified to suit the control applications.
The microcontroller 6801 family includes On chip Input / Output ports, an Asynchronous serial communication device and 16 bit timer modules.
The Motorola Microcontroller family was first introduced in 1978 and is built in the same pattern of the microprocessor 6800. The Microcontroller 6801 family was designed similar as the microprocessor 6800, its design and instruction set modified to suit the control applications.
The microcontroller 6801 family includes On chip Input / Output ports, an Asynchronous serial communication device and 16 bit timer modules.
The Microcontrollers 6801. 6803,
6805. 6811 are available from Motorola Company. The 6811 microcontroller family
have different version with ROM, RAM, EPROM, and EEPROM.
A micro controller is also known
as embedded controller. Today various types of microcontrollers are available
in market with different word lengths such as 4bit, 8bit, 64bit and 128bit
microcontrollers.
**Write a short note on Microcontroller applications.
Microcontroller
Applications:
Microcontrollers
usually low-power requirements for many devices. Microcontrollers are used in
many consumer electronics, car engines, computer peripherals and test or
measurement equipment. And these are well suited for long lasting battery
applications
Programmable microcontrollers are
designed for embedded applications, unlike microprocessors can be found in PCs. Microcontrollers are
used in automatically controlled devices including power tools, toys,
implantable medical devices, office machines, engine control systems,
appliances, remote controls and other types of embedded systems.
Application
of Microcontroller in Day to Day Life Devices:
·
Light sensing & controlling devices
·
Temperature sensing and controlling devices
·
Fire detection & safety devices
·
Industrial instrumentation devices
·
Process control devices
Application
of Microcontroller in Industrial Control Devices:
·
Industrial instrumentation devices
·
Process control devices
Application
of Microcontroller in Metering & Measurement Devices:
·
Volt Meter
·
Measuring revolving objects
·
Current meter
·
Hand-held metering systems
**Explain
the classification of microcontroller or types of microcontroller
The
microcontrollers are characterized as bus-width, instruction set, and memory
structure. For the same family, there may be different forms with different
sources. The types of microcontroller are characterized by their bits, memory
architecture, memory/devices and instruction set.
Types of
Microcontroller:
Microcontrollers are divided into categories
according to their memory, architecture, bits and instruction sets.
Bits:
·
8 bits microcontroller executes logic &
arithmetic operations. Examples of 8 bits micro controller is Intel 8031/8051.
·
16 bits microcontroller executes with greater
accuracy and performance in contrast to 8-bit. Example of 16 bit microcontroller
is Intel 8096.
·
32 bits microcontroller is employed mainly in
automatically controlled appliances such as office machines, implantable
medical appliances, etc. It requires 32-bit instructions to carry out any
logical or arithmetic function.
Memory:
External Memory
Microcontroller
– When an embedded system has a microcontroller unit & that has not all the functional blocks
available on a chip is called an external memory microcontroller. For example,
8031 has no program memory on the chip is an external memory microcontroller.
· Embedded Memory Microcontroller –When an embedded system has a microcontroller unit that
has all the functional blocks available on a chip is called an embedded
microcontroller. For example, 8051 having program & data memory, I/O ports,
serial communication, counters and timers and interrupts on the chip is an
embedded microcontroller.
· CISC- CISC means complex
instruction set computer, it allows the user to apply 1 instruction as an
alternative to many simple instructions.
· RISC- RISC
means Reduced Instruction Set Computers. RISC reduces the operation time by
shortening the clock cycle per instruction. this type of instruction sets
reduces the design of microprocessor for industry standards. It allows each
instruction to operate on any register or use any addressing mode and
simultaneous access of program and data. The RISC gives a better execution than
the CISC.
Memory
Architecture:
Harvard
Memory Architecture Microcontroller : The point when a microcontroller unit has a
dissimilar memory address space for the program and data memory, the
microcontroller has Harvard memory architecture in the processor.
Program Memory of 8051
Data Memory of 8051
Princeton Memory
Architecture Microcontroller: The point
when a microcontroller has a common memory address for the program memory and
data memory, the microcontroller has Princeton memory architecture in the
processor.
8051
Microcontroller:
The most universally employed set of
microcontrollers come from the 8051 family. The two other members of this
8051 family are-
·
8052 – This microcontroller has 3 timers
& 256 bytes of RAM. Additionally it has all the features of the traditional
8051 microcontroller. 8051 microcontroller is a subset of 8052 microcontroller.
·
8031 – This microcontroller is ROM less,
other than that it has all the features of a traditional 8051 microcontroller.
For execution an external ROM of size 64K bytes can be added to its chip.
8051 microcontroller brings into play 2
different sorts of memory such as- NV-RAM, UV-EPROM and Flash.
**
Explain the development tools for microcontroller .
Development
tools for micro controllers:
The development system is used by system
designers to design and test.
The microprocessor development system
consists of a set of hardware and software tools.
The hardware of development system contains a
standard pc, printer and an emulator. The software tools are also called
program development tools.
They are editor, Assembler, Library builder,
Linker, Debugger and simulator.
The software tools can be run on the PC to
write, assemble, debug, modify and test the assembly language programs.
The use of program development tools :
·
Define the problem carefully.
·
Use an editor to create the source file for
ALP.
·
Assemble the Source file with the assembler.
·
If assembler list file indicates errors then
use editor and correct the errors.
·
Cycle through the edit-assemble loop until
all errors indicated by assembler are cleared.
·
Use linker to link all object files of program
modes and library files into a single
executable file.
·
If the linker indicates any error then modify
the source program, re assemble and re link to correct the errors.
·
If the developed program does not interact
with any external hardware other than that directly connected to the system,
then we can use the system debugger to run and debug our program.
·
If the designed program is intended to work
with external hardware then use an
emulator to run and debug the program.
·
** Write a short note on assembler.
Assembler: The assembler is a software tool which ,when
run on a PC ,converts the assembly language program to machine language
program.
There are several types of assemblers, they
are one pass assembler,two pass assembler, macro assembler, cross assembler,
resident assembler and meta assembler.
One pass assembler is used to translate the
source code, it is very fast but because of the forward reference problem, the
one pass assembler is not used.
Most of the popularly used assemblers are two
pass assembler. It is used to translate the source code into machine code.
The assembler usually generates two o/p files
called (1) object file and (2) List
file.
Advantages
of the assembler:
§ The assembler translates mnemonics into binary
code with speed and accuracy, thus eliminating human errors in looking up the
codes.
§ The
assembler assigns appropriate values to the variables used in a program. This
feature offers flexibility in specifying jump locations.
§ It is
easy to insert or delete instructions in a program and re assemble the entire
program quickly with new memory locations and modified addresses for jump
locations. This avoids rewriting the program manually.
§ The
assembler checks syntax errors, such as wrong lables, opcodes, expressions
etc.. and provides error messages. However it cannot check logic errors in a
program.
§ The
assembler can reserve memory locations for data or results.
§ The
assembler provides list file for documentation.
**Write
a short note on Simulator :
Simulator
: The simulator is a
program which can be run on the development system to simulate the operations
of the newly designed system. The operations can be simulated as
1.
Execute a program and display result.
2.
Single step execution of a program
3.
Break-point execution of a program
4.
Display the contents of register/memory.
Simulator usually show the contents of
registers and memory locations on the screen of computer and allow the system
designer to perform all of the operations.
The simulators do not have the ability to
perform actual I/O or internal hardware operations.
**
Write a short note on Debugger.
Debugger: The
debugger is a software tool that allows the execution of a program in single
step or break-point mode under the control of user. The process of locating and
correcting the errors in a program using a debugger is known as debugging.
The debugger allows the designer to look at
the contents of registers and memory locations after running the program.
It allows the system designer to change the
contents of registers and memory locations and return the program.
Some debuggers allow the user to stop
execution after each instruction, so that the memory/register content can be
checked. A debugger also allows the user to set a break point at any point in
user program.
When the user run the program the PC will
execute instructions upto this break point and stop.
The user can then examine register and memory contents to see whether the results are correct upto that point.
If the
results are correct, the user can move the break point to a later point in the
program. If the results are not correct, the user can check the program up to
that point to find out why they are not correct.
The debugger tools help the user to isolate a
problem in the program. Once the problem/errors are identified,
Tthe algorithm can be modified. Then the user
can be use the editor to correct the
source program, re assemble the corrected source program, relink and run the
program again.
** Write
a short note on compiler.
Compiler:
Compiler is a program that transforms higher language source code(such
as c code) to the lower language code(assembly language/machine code/binary
code/object code).
This object code can be
ported on any target such as microcontroller/processor.
The reason for this conversion is to create an executable program for the
desired target.
When the target compiled
program runs on a computer/platform/system in which CPU/operating system is
different from where compiler is installed,this compiler is referred as cross-compiler.
Tools such as µVision are
widely used as compiler for different microcontroller variants. The µVision
helps create and test embedded applications for ARM/Cortex-M C166/C251/C51 microcontrollers.
. A compiler creates machine
code that runs on a processor with a specific Instruction Set Architecture
(ISA).
Source-to-source compilers
translate one program, or code, to another of a different language (e.g., from
Java to C).
Choosing a compiler means
first we need the ISA, operating system, and the programming language. When a
CPU is completely useless without software to run on it. Compilers will report
errors after compiling has finished.
The Microcontrollers 6801. 6803,
6805. 6811 are available from Motorola Company. The 6811 microcontroller family
have different version with ROM, RAM, EPROM, and EEPROM.
A micro controller is also known
as embedded controller. Today various types of microcontrollers are available
in market with different word lengths such as 4bit, 8bit, 64bit and 128bit
microcontrollers.
Comments
Post a Comment