Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
ON
BACHELOR OF TECHNOLOGY
NISHA RANI
June,2013
CONTENTS
Page No
Certificate i
Acknowledgement ii
Abstract iii - iv
List of Figures v
List of Tables vi
List of Abbreviations vii - ix
Chapter 1 : INTRODUCTION ABOUT THE COMPANY 1-4
1.1 Company Profile 1
1.1.1 Promoters 1
1.1.2 Products 2
1.1.3 R&D 2
1.1.4 After Sales Service 2
1.2 Training 2
1.2.1 Faculty Profile 2
1.3 Course Offered 3
1.3.1 Education Programs 3-4
Chapter 2 : INTRODUCTION ABOUT TRAINING WORK 5-9
2.1 Embedded System 5
2.1.1 Introduction 5
2.1.2 Characteristics of Embedded Products 6
2.1.3 Embedded Products in Today Industry 6
2.2 Microprocessor Unit (MPU) 7
2.3 Microcontroller Unit (MCU) 7
2.4 Comparison between Microprocessor and Microcontroller 7-9
3.1 Microcontroller 10
3.1.1 Introduction 10
3.5 Registers 16
3.6.1 Introduction 19
4.2.1 Introduction 37
5.1 Conclusion 39
5.2 Application 39
5.3 Benefits 39
REFERENCES
i
CERTIFICATE
This report has been submitted for the award of B, Tech Degree.
ACKNOWLEDGEMENT
Success is a sweet fruit, which everyone strives to taste. To achieve this goal, one has to
put in a lot of physical and mental efforts. While writing this report, I gain a stronger
appreciation for the following fact: I couldn’t do it without the help of many talented and
dedicated people. So I wish to express my appreciation to those whose help has been
most valuable.
Firstly, I would like to express my gratitude and appreciation to Mr. ANIL PUNIA
(Director, HCL CDC HISAR) who explained me everything about the training process
at the company and made me familiar with the company staff. I am equally grateful to
Mr. VINAY KHATOR who guided me in completing this training and project work
successfully and was always there to help me in sorting out the problems during the
training.
Finally, I would like to say thanks to all the staff of the company and the faculty of my
esteemed institute for their kind co-operation.
ABSTRACT
MY EXPERIENCES:
With the completion of this training, I am now aware of the Microcontroller 8051. I have
worked for four complete months in the Embedded systems. I have worked almost as an
engineer to the extent of my technical capabilities. Doing all these, I have acquired a lot
of knowledge about the working of Microcontroller with Embedded C Programming and
its Software (Keil and Flash Magic).
I was the part of one of the most happening and demanding field of electronics i.e. 8051
Microcontroller started and spending four months into it really proved very useful to me
and I have gained a lot out of it :
1 I got the knowledge of uC 8051 (Harward Architecture & Cisc type).
2 I worked practically on the software Keil u vision, Flash Magic, Proteus.
3 I worked practically which helped me in being more familiar to the interfacing of
different display devices which I am supposed to do in the long run.
4 I learned basic concepts of electronics which helped me to understand more.
5 Training helped me increasing my working skills and the knowledge in this field
and also showed me the atmosphere that we have to join after completion of the
degree program.
Finally, the main advantage of this training was that it has now enabled me to explore
myself in the giant Robotic industry. This training report is all about the embedded
systems and its application in various fields of real world. We are living in the
Embedded World. We are surrounded with many embedded products and our daily life
largely depends on the proper functioning of these gadgets. Television, Radio, CD
player, Washing Machine or Microwave Oven in our kitchen, Card readers, Access
Controllers, Palm devices of our work space enable us to do many of our tasks very
effectively. Apart from all these, many controllers embedded in our car take care of car
operations between the bumpers. All kinds of magazines and journals regularly dish out
details about latest technologies, new devices; fast applications which make us believe
that our basic survival is controlled by these embedded products. Now we can agree to
the fact that these embedded products have successfully invaded into our world. What is
iv
LIST OF TABLES
LIST OF ABBREVIATIONS
Ω : Ohm
% : Percentage
AC : Auxiliary Carry
ADC : Analog Digital Converter
ALE : Address Latch Enable
ALU : Arithmetic and Logical Unit
ATMS : Automatic Tiller Machines
BF : Busy Flag
BJT : Bipolar Junction Transistor
CISC : Complex Instruction Set Computer
CLR : Clear
CPU : Central Processing Unit
CRT : Cathode Ray Tube
CY : Carry
DDRAM : Display Data RAM
DIP : Dual Input Package
DIV : Division
DPTR : Data Pointer
DR : Date Register
DSP : Digital Signal Processing
E, EN : Enable
EA : Enable Address
ECG : Electrocardiogram
EEPROM : Electrical Erasable Programming ROM
EPROM : Erasable Programming ROM
EX-OR : Exclusive OR
EX – NOR : Exclusive NOR
FIR : Finite Impulse Response
GaAs : Gallium Arsined
GaAsP : Gallium Arsined Phosphate
viii
GaP : Gallium Phosphate
GND : Ground
HEX : Hexa decimal
Hz : Hartz
I/O : Input
IC : Integrated Circuit
IIR : Infinite Impulse Response
INT0 : Interrupt 0
INT1 : Interrupt 1
IR : Instruction Register
LCD : Liquid Crystal Display
LED : Light Emitting Diode
mA : Milli Ampere
MOS : Metal Oxide Semiconductor
MRI : Magnetic Resonance Imaging
MSB : Most Significant Bit
MUL : Multiplication
NRZ : Non Return to Zero
NOP : No Operation
O/P : Output
OV : Overflow
PIC : Peripheral Interface Controller
PSEN : Program Store Enable
R/W : Read and Write
RAM : Random Access Memory
RD : Read
RISC : Reduce Instruction Set Computer
ROM : Read Only Memory
RS : Register Set
RST : Reset
RXD : Receiving Data
Seg : Segment
SETB : Set Bit
ix
SFR : Special Function Register
SP : Stack Pointer
T0 : Timer 0
T1 : Timer 1
TCON : Timer Control
TMOD : Timer Mode
TTL : Transistor Transistor Logic
TXD : Transmitting Data
uC : Microcontroller
uP : Microprocessor
UART : Universal Asynchronous Receiver Transmitter
V : Volt
VCC : Voltage
VCR : Visual Control Room
VEE : Power Supply
VLSI : Very Large Scale Integration
WR : Write
Chapter 1: INTRODUCTION ABOUT THE COMPANY
1.1 COMPANY PROFILE:
Neo Technology established in the year 2009 is an embedded design house. It provides
out-of-the-box solution from concept to reality. It is registered with Small Scale
Industries with Chandigarh Administration.
Neo Technology consists a group of talented and experienced business professionals who
are dedicated to maintaining a standard of excellence, while providing personalized
services and the highest quality of Products at the lowest price as possible as in the
market place.
The well – versed executives, engineers are all trained in this field for years together and
successfully developed latest technologies as well as gained managing capabilities. The
Company has built a resource base of high innovate professionals and state-of-art
Manufacturing in a very short time.
Neo Technology has been identified as a reputed and innovative manufacturer of
Electronics Hardware & Software. Today the company has grown progressively with a
composite infrastructure base and a strong liquidity. It looks forward to serve the varied
Industrial & Consumer Customers by providing state-of-the-art equipments, Services &
Solutions.
The Company undertakes various turnkey projects related to industrial automation,
domestic applications and higher end biomedical applications. It deals in Four
Technological Domains
VLSI (Very Large Scale Integration)
PLC’s & SACADA
Micro-controllers
Digital Signal Processing
Embedded Wireless
1.1.1 PROMOTERS
Mr. Sitendar Kumar (Phd. in ECE), the architect of the Neo Technology is a self made
man and a man of vision. His foresight & 16 years experience of maintaining high
quality standards, has shown success and company flourished rapidly. With a
background in Electronics Engineering, he bring his intellectual skills in the field of
management, marketing & business development and play a vital role in the company’s
success graph.
1.1.2 PRODUCTS
The Company develops protoboards in the respective domains, which are used in
educational institutes. These protoboards are so designed that a student working on it
develops a complete knowledge from firmware development to interfacing to various
active and passive components.
They are authorized channel partners and sole distributor of various world-class real-time
software in the respective domains. They are the most powerful vendors in the northern
sector of India, as they provide prompt and complete prior and after sales service to the
customers purchasing software and hardware from them.
1.1.3 R & D
Neo Technology has state-of-the-art computerized design facilities and a team of design
engineers to develop any equipment as per the customer’s need. All arrangements are
made right from start to end of project i.e. designing, manufacturing, installation etc.
1.2 TRAINING
In educational programs, training is imparted in all the four domains. Training is such
that it equips a student to use the practical knowledge gained here, fully in the field.
They also undertake training for corporate in all the respective domains.
2.1.1 Introduction:
Embedded Systems are inseparable part of our life. Whether we are at home or office or
on the move, we are always surrounded by embedded systems. Starting from home
appliances like TV, washing machine and systems like printer and elevator in workplace
to the automobiles and automatic traffic control system are all examples of embedded
systems. All kinds of magazines and journals regularly dish out details about latest
technologies, new devices; fast applications which make us believe that our basic
survival is controlled by these embedded products. Embedded system is a combination of
Hardware and Software Design to meet a specific need with performance in given time
frame. Component in an embedded system are as: Hardware, Input & Output and Software as
shown in figure 2.1.
3.1 MICROCONTROLLERS:
3.1.1 INTRODUCTION:
Circumstances that we find ourselves in today in the field of microcontrollers had their
beginnings in the development of technology of integrated circuits. This development
has made it possible to store hundreds of thousands of transistors into one chip. That was
a prerequisite for production of microprocessors, and the first computers were made by
adding external peripherals such as memory, input-output lines, timers and other. Further
increasing of the volume of the package resulted in creation of integrated circuits. These
integrated circuits contained both processor and peripherals. That is how the first chip
containing a microcomputer, or what would later be known as a microcontroller came
about. The first microcontroller 8051 was developed by Intel Corporation in the year
1981. it was called as a “System on a chip”. A microcontroller 8051 is shown in figure
3.1.
Assembly language is often used in microcontrollers and since they usually follow RISC
architecture, the instruction set is small. The development package of microcontrollers
often includes an assembler, a simulator, a programmer to "burn" the chip and a
demonstration board. Some packages include a high level language compiler such as a C
compiler and more sophisticated libraries.
Most microcontrollers will also combine other devices such as:
A Timer module to allow the microcontroller to perform tasks for certain time
periods.
A serial I/O port to allow data to flow between the microcontroller and other
devices such as a PC or another microcontroller.
An ADC to allow the microcontroller to accept analogue input data for processing.
The 8051 is a high performance single chip computer intended for use in
sophisticated real time applications such as instrumentation, industrial control and
computer peripherals. It provides extra features like interrupts, bit address ability
and an enhanced set of instructions, which makes the chip very powerful and cost
effective.
Timers 2 2 3 3
I/O Pins 32 32 32 32
Serial Port 1 1 1 1
Interrupt Sources 6 6 7 7
3.5 Registers:
The Accumulator:
The Accumulator, as its name suggests, is used as a general register to
accumulate the results of a large number of instructions. It can hold an 8-bit (1-byte)
value and is the most versatile register
The "R" registers:
The "R" registers are a set of eight registers that are named R0, R1, etc. up to and
including R7. These registers are used as auxiliary registers in many operations.
The "B" Register:
The "B" register is very similar to the Accumulator in the sense that it may hold
an 8-bit (1-byte) value. The "B" register is only used by two 8051 instructions: MUL AB
and DIV AB.
The Data Pointer (DPTR):
The Data Pointer (DPTR) is the 8051’s only user-accessible 16-bit (2-byte)
register. The Accumulator, "R" registers, and "B" register are all 1-byte values. DPTR, as
the name suggests, is used to point to data. It is used by a number of commands which
allow the 8051 to access external memory.
The Program Counter (PC):
The Program Counter (PC) is a 2-byte address which tells the 8051 where the
next instruction to execute is found in memory. When the 8051 is initialized PC always
starts at 0000h and is incremented each time an instruction is executed.
The Stack Pointer (SP):
The Stack Pointer, like all registers except DPTR and PC, may hold an 8-bit (1-
byte) value. The Stack Pointer is used to indicate where the next value to be removed
from the stack should be.
PSW (Program Status Word) Register:
Program status word register is an 8 bit register. It is also referred to as the flag
register. Although the PSW register is 8 bits wide, only 6 bits of it are used by the 8051.
The unused bits are user-definable flags. Four of the flags are called conditional flags,
meaning that they indicate some conditions that result after an instruction is executed.
These four are CY (carry), AC (auxiliary carry), P (parity) and OV (overflow).
The IC-tester tests the basic logic gates used in the digital laboratory of colleges.
It uses 89c51 as the controlling and processing unit. The input is given to the
corresponding pins of the IC to be tested using program stored in micro-controller. The
output is taken from the relevant pin. It is compared with the look-up table of that IC
being stored in the memory. Depending on the result of comparison, the output is
displayed in the LCD display.
FAMILY : TTL
RANGE : Logic Gates can be tested.
TEST SOCKETS : A single 14 pin ZIF sockets for IC Testing.
PACKAGE : DIP14, 16, 20 and 24 pins.
DISPLAY : 16X2 LCD Display.
INDICATOR LEDs : 1 bright LEDs of 3 mm each.
ELECTRICAL : 230 V (+/- 10 %), 1 phase, 50 Hz (+/- 2 %)
3.7 CIRCUIT DIAGRAM:
The circuit diagram of IC tester is shown in figure 3.5.
RESISTOR:
A resistor is a two-terminal electronic component that produces a voltage across
its terminals that is proportional to the electric current through it in accordance with
Ohm's law:
V=IR
Units
The ohm (symbol: Ω). commonly used multiples and submultiples in electrical
and electronic usage are the milliohm (1x10-3), kilohm (1x103), and megaohm (1x106).
The resistor is shown in figure 3.6.
Each color corresponds to a certain digit, progressing from darker to lighter colors, as
shown in the chart 3.4 below.
CAPACITOR:
Capacitor is a passive electronic component consisting of a pair of conductors
separated by a dielectric as shown in figure 3.7. When a voltage potential difference
exists between the conductors, an electric field is present in the dielectric. This field
stores energy and produces a mechanical force between the plates.
An ideal capacitor is characterized by a single constant value, capacitance, which is
measured in farads.
C=Q/V
CRYSTAL OSCILLATOR:
A crystal oscillator is an electronic circuit as shown in figure 3.8 that uses the
mechanical resonance of a vibrating crystal of piezoelectric material to create an
electrical signal with a very precise frequency. This frequency is commonly used to keep
track of time (as in quartz wristwatches), to provide a stable clock signal for digital
integrated circuits, and to stabilize frequencies for radio transmitters and receivers. The
most common type of piezoelectric resonator used is the quartz crystal, so oscillator
circuits designed around them were called "crystal oscillators".
D1
R3
RP1 LCD1
220 RESPACK-8
LED-GREEN LM016L
2
3
4
5
6
7
8
9
C1
U1
VDD
VSS
VEE
RW
RS
D0
D1
D2
D3
D4
D5
D6
D7
E
19 39
XTAL1 P0.0/AD0
33p X1 P0.1/AD1
38
1
2
3
4
5
6
7
8
9
10
11
12
13
14
CRYSTAL 37
C2 P0.2/AD2
18 36 R2
XTAL2 P0.3/AD3
35
P0.4/AD4
34
P0.5/AD5 1k
33p 33
P0.6/AD6
9 32
RST P0.7/AD7
C3 P2.0/A8
21
10u 22
P2.1/A9
23
P2.2/A10
29 24
PSEN P2.3/A11
30 25
ALE P2.4/A12
31 26
EA P2.5/A13
R1 P2.6/A14
27
10k 28
P2.7/A15
1 10
P1.0 P3.0/RXD
2 11
P1.1 P3.1/TXD
3 12
P1.2 P3.2/INT0
4 13
P1.3 P3.3/INT1
5 14
P1.4 P3.4/T0
6 15
P1.5 P3.5/T1
7 16
P1.6 P3.6/WR
8 17
P1.7 P3.7/RD
AT89C51
PROGRAM=D:\program\ictester.HEX
2
U2:A
7408
3
Fig3.6 RESISTOR
Fig3.7 CAPACITOR
Black 0 0 ×100
Brow
1 1 ×101 ±1% (F) 100 ppm
n
Oran
3 3 ×103 15 ppm
ge
Yello
4 4 ×104 25 ppm
w
Gree
5 5 ×105 ±0.5% (D)
n
Viole
7 7 ×107 ±0.1% (B)
t
Whit
9 9 ×109
e
Silve
×10-2 ±10% (K)
r
DIODE:
In electronics, a diode is a two-terminal device. Diodes have two active
electrodes between which the signal of interest may flow, and most are used for their
unidirectional electric current proper. Diode figure is shown in 3.10.
The most common function of a diode is to allow an electric current to pass in one
direction (called the forward biased condition) and to block the current in the opposite
direction (the reverse biased condition).
Fig.3.9 LIQUID CRYSTAL DISPLAY
ZIF SOCKET:
ZIF stands for “ZERO INSERTION FORCE”. ZIF is a type of IC socket that
requires very little force for insertion as shown in figure 3.12. ZIF socket allow the
socket to open to receive the pin without pressure and then close around the pin to give a
good, solid connection. With a ZIF socket before the IC is inserted, a lever or slider on
the side of the socket is moved, pushing all the sprung contact apart so that the IC can be
inserted with very little force. ZIF socket is commonly used for chip testing, IC testing
and programming equipment.
POWER SUPPLY CIRCUIT:
BRIDGE RECTIFIERS:
Bridge rectifier circuit consists of four diodes arranged in the form of a bridge as
shown in figure3.13.
OPERATION:
During the positive half cycle of the input supply, the upper end A of the
transformer secondary becomes positive with respect to its lower point B. This makes
Point1 of bridge positive with respect to point2. The diode D1 & D2 become forward
biased & D3 & D4 become reverse biased. As a result a current starts flowing from
point1, through D1 the load & D2 to the negative end.
During negative half cycle, the point2 becomes positive with respect to point1. DiodeD1
& D2 now become reverse biased.
TRANSFORMER:
DEFINITION:
The transformer is a static electro-magnetic device that transforms one alternating
Voltage (current) into another voltage (current).However; power remains the same
during the transformation. Transformers play a major role in the transmission and
distribution of ac power.
PRINCIPLE:
Transformer works on the principle of mutual induction. A transformer consists
of laminated magnetic core forming the magnetic frame. Primary and secondary coils are
wound upon the two cores of the magnetic frame, linked by the common magnetic flux.
When an alternating voltage is applied across the primary coil, a current flows in the
primary coil producing magnetic flux in the transformer core. This flux induces voltage
in secondary coil shown in figure 3.14.
A transformer is a device that transfers electrical energy from one circuit to another
through inductively coupled electrical conductors. A changing current in the first circuit
(the primary) creates a changing magnetic field; in turn, this magnetic field induces a
changing voltage in the second circuit (the secondary). By adding a load to the secondary
circuit, one can make current flow in the transformer, thus transferring energy from one
circuit to the other. It is the phenomenon of mutual induction.
The secondary induced voltage VS, of an ideal transformer, is scaled from the primary VP
by a factor equal to the ratio of the number of turns of wire in their respective windings:
The logic to test an IC is very simple. We can test it using their truth tables and
functional tables. In case of logic gates, we should check truth tables. Different IC’s are
used for different logic gates. These are:-
1. 7408 - AND
2. 7432 - OR
3. 7404 - NOT
4. 7400 - NAND
5. 7402 - NOR
6. 7486 - EX-OR
7. 74266 - EX-NOR
Fig3.12 ZIF SOCKET
7408 IC. 7408 IC is use for AND gate. In this IC 14 pins are present. In which two
pins are input and one pin is output. In 7408 IC four AND gates are use. One pin is for
Vcc and one is for ground. Two inputs are present on first and second terminal and
output is on third terminal as shown in figure 3.15.
7432 IC. 7432 IC is use for OR gate. In this IC 14 pins are present. In which two pins
are input and one pin is output. In 7432 IC four OR gates are use. One pin is for Vcc and
one is for ground. Two inputs are present on first and second terminal and output is on
third terminal as shown in figure 3.16.
7400 IC. 7400 IC is use for NAND gate. In this IC 14 pins are present. In which two
pins are input and one pin is output. In 7400 IC four NAND gates are use. One pin is for
Vcc and one is for ground. Two inputs are present on first and second terminal and
output is on third terminal as shown in figure 3.18.
7486 IC. 7486 IC is use for EX-OR gate. In this IC 14 pins are present. In which two
pins are input and one pin is output. In 7486 IC four EX-OR gates are use. One pin is
for Vcc and one is for ground. Two inputs are present on first and second terminal and
output is on third terminal as shown in figure 3.20
In all gates except NOT & NOR first two terminals are the inputs and the third
terminal is the output. So we are externally giving inputs to first 2 pins of IC and
checking the 3rd terminal. If the desired output is obtained, LCD displays PASS and if
the output is wrong, LCD displays FAIL. In NOT gate we are giving input only one
terminal and the output is obtained on second terminal.
In NOR gate the inputs are giving on second and third terminal of the IC and the
output is obtained on first terminal.
CHAPTER4: EVALUTION OF TRAINING
4.1 LCD INTERFACING:
4.1.1 PIN CONFIGURATION:
LCD in the board is 16X2 characters display. As shown in figure 4.1.
LCD stands for Liquid Crystal Display. The most commonly used LCDs found in
the market today are 1 Line, 2 Line or 4 Line LCDs which have only 1 controller and
support at most of 80 characters.
8 data pins D7:D0:
Bi-directional data/command pins. Alphanumeric characters are sent in ASCII
format.
RS: Register Select:
RS = 0 -> Command Register is selected
RS = 1 -> Data Register is selected
R/W: Read or Write:
0 -> Write, 1 -> Read
E: Enable (Latch data):
Used to latch the data present on the data pins.
A high-to-low edge is needed to latch the data.
VEE: contrast control:
4.1.2 DDRAM - DISPLAY DATA RAM:
Display data RAM (DDRAM) stores display data represented in 8-bit character
codes. Its extended capacity is 80 X 8 bits, or 80 characters. The area in display data
RAM (DDRAM) that is not used for display can be used as general data RAM. So
whatever you send on the DDRAM is actually displayed on the LCD.
4.1.3BF - BUSY FLAG:
Busy Flag is a status indicator flag for LCD. When we send a command or data to the
LCD for processing, this flag is set (i.e. BF =1) and as soon as the instruction is executed
successfully this flag is cleared (BF = 0). This is helpful in producing and exact amount
of delay. For the LCD processing to read Busy Flag, the condition RS = 0 and R/W = 1
must be met and The MSB of the LCD data bus (D7) act as busy flag. When BF = 1
means LCD is busy and will not accept next command or data and BF = 0 means LCD is
ready for the next command or data to process
4.1.4 INSTRUCTION REGISTER (IR) AND DATA REGISTER (DR):
There are two 8-bit registers controller Instruction and Data register. Instruction
register corresponds to the register where you send commands to LCD e.g. LCD shift
command, LCD clear, LCD address etc. and Data register is used for storing data which
is to be displayed on LCD. When send the enable signal of the LCD is asserted, the data
on the pins is latched in to the data register and data is then moved automatically to the
DDRAM and hence is displayed on the LCD.
Digit Seg. h Seg. g Seg. f Seg. e Seg. d Seg. c Seg. b Seg. a HEX
0 1 1 0 0 0 0 0 0 C0
1 1 1 1 1 1 0 0 1 F9
2 1 0 1 0 0 1 0 0 A4
3 1 0 1 1 0 0 0 0 B0
4 1 0 0 1 1 0 0 1 99
5.2 APPLICATIONS:
In electronic industries.
Research center
In college laboratory
5.3 BENEFITS: