Professional Documents
Culture Documents
REPORT
Submitted for partial fulfillment of award of
Submitted by:
Shivinder singh
Uni.Roll No:617041617
College Roll No: EC05L5437
3rd Year ECE
CONTENTS
1) Company profile
2) PCB Designing
Functions of PCB
Classifications of PCBs
Technique used for PCB design
PCB design software
3) OrCad design environment
PCB design steps in OrCad
i. Entry to schematic
ii. Creating Netlist
Placement of Layout Plus
Setting board parameters
Creating board outline
Placement of components
Conductor routing
Design rule check
Post processing
4) Power system design
Unregulated power supplies
Regulated power supplies
Bench supply diagram
5) Embedded Systems
What is Embedded System
Applications
Difference between microprocessor & micro controller
2
ACKNOWLEDGEMENT
First of all I would like to thank almighty GOD who has given this wonderful gift of life to
us. He is the one who is guiding us in right direction to follow noble path of humanity. In
my six months industrial training it is a wonderful experience to be a part of NETMAX
TECHNOLOGIES where I have opportunity to work under brilliant minds. I owe my deep
regards for the supporting and kind staff authorities who are helping me in my lean patches
during these six months. The knowledge I am gaining throughout my studies have the
practical implementation during this period. I am grateful to all the staff of NETMAX and
for their timely support and sharing of their experience with me. I would like to express my
heartiest concern for Mr. ROHIT KHOSLA for his able guidance and for his inspiring
attitude, praiseworthy attitude and honest support. Not to forget the pain staking efforts of
our college training and placement cell and specially my training and placement officer Mr.
Charanjeet Singh. Last but not the least I would express my utmost regards for the
electronics and communication department of our Institute.
COMPANY PROFILE
Netmax Technologies is an organization which is established in the field of Network
Support, Network training and Embedded systems. It provides support and training in the
field of networking solutions (CISCO, LINUX) and embedded systems (Micro controller
based design, Electronics system design).
In Education, it has strategic alliance with REDHAT Inc. It is also NOVELL
EDUCATION PARTNER with which it provides NOVELL and SUSE LINUX courses.
Netmax technologies also conduct courses in CADENCE based design tools.
Netmax Technologies also provide Technical Research & Development support and
consultancy to some Electronics companies.
Their clients for R&D support in field of embedded systems are:
1)
2)
3)
4)
5)
CEDTI, Mohali
Premier ISP, Chandigarh
Innovative Solutions, Chandigarh
Emmtel ISP, Chandigarh
NIPER, Mohali
Navik Technologies, Chandigarh
Software Technology Parks India, Mohali
Glide Internet Services
Rana Group
IDS
HFCL Infotel Ltd.
Targus technologies pvt ltd
STPI, Mohali
BBMB
The Tribune
Quark
5
17)
Ind Swift
PCB DESIGNING
PCB stands for PRINTED CIRCUIT BOARD. Printed circuit board (PCB) provides
both the physical structure for mounting and holding the components as well as the
electrical interconnection between the components. That means a PCB = PWB (printed
wiring board) is the platform upon which electronic components such as integrated circuit
chips and other components are mounted. A PCB consists of a non-conducting substrate
(typically fiber glass with epoxy as resin) upon which the conductive pattern or circuitry is
formed. Copper is the most prevalent conductor although nickel, silver and tin are also
used in some cases.
Types of PCB
PCB may be of different types:1) Single-sided
2) Double-sided
3) Multilayer
Single sided PCBs: - As the name suggest in these designs the conductive pattern is only at
in one side. And also the size is large in these case but these are cheap.
Double sided PCBs: - These are the PCBs on which the conductive pattern is in on both
sides. The size of board is small in this case but it is costlier than that of above.
Multilayer PCBs: - In this case the board consists of alternating layers of conducting
pattern and insulating material. The conductive material is connected across the layers
through plated through holes. The size of this PCB is smaller than that of double sided
PCB but it is very costly.
PCBs may also be either rigid, flexible, or the combination of two (rigid-flex). When the
electronic components have been mounted on the PCB, the combination of PCB and
7
Capture
Gerber
tools
Libraries
Layout
Footprint
libraries
Gerber and
plotter
drawing
Gerber
and drill
files
The most commonly software which are used for PCB design in India are Protel and
OrCad
11
12
13
help for an error message, put the cursor in the error message line in the session log press
F1.
The ruler along the top appears in either inches or mill meters, depending on which
measurement system is selected in the window panel. Your tab setting are saved and used
each time you start capture.
One can search for information in the session log using the find command on the Edit
menu. You can also save the contents of the of the session log to a file, which is useful
when working with Orcads technical support to solve technical problems. The default
filename is SESSION.TXT.
The Toolbar:
Captures toolbar is dock able (that means you can select and drag the toolbar to new
location) as well as resizable, and displays tool tips for each tool; by choosing a tool button
14
you can quickly perform a task. If tool button is dimmed, you cant perform that task in the
current situation.
Some of the tools operate only on what you have selected, while others give you a choice
of either operating on what is selected or expanding the scope to entire project.
You can hide the toolbar, then display it again when u need it. For hiding select from the
schematic page editors view menu, choose TOOLBAR.
15
Place components: Use the components tool in order to place manually the
components which are fixed by the system designer on the board or otherwise use
auto-placement.
Route the board: Use different routing technologies to route the board and take
advantage of push and shove (a routing technology), which moves track you are
currently routing as well as you can also auto route the board.
Provide finishing of the board: Layout supplies an ordered progression of commands
on the auto menu for finishing your design. These commands include design rule
check, cleanup design, rename components, back annotate, run post processor, and
create reports.
The design window:
The design window provides a graphical display of printed circuit board, it is primary
window you use when designing your board. It also provides tools to facilitate the
design process such as to update components and design rule violation.
18
Main window
19
Design window
Select the technology template (.TCH), then choose the open button and load the net
list in other box.
Then apply the auto ECO.
If necessary, respond to link footprints to component dialog.
Draw the board outline by using the obstacle tool in the tool bar.
Setting board parameters:
There is some parameter which should be set before placing the components on board.
They are as follows:-
20
Set Datum
Create a board outline
Set units of measurements
Set system grid
Add mount holes
Creating of board outline:
Board outline is the graphical representation of the size of the actual PCB board. So it is
the main step in layout, to draw the board outline of the actual size of PCB board.
Placement of components:
Placement of components means that to place the components in designed box. A designer
should follow the following steps before going for it: Optimize the board for component placement.
Load the placement strategy file.
Place components on the board.
Optimize placement using various placements
Components can be placed by using two techniques:1) Manual placement of components
2) Auto placement of components
Choose the components tool bar button. From the pop up men, choose the queue for
placement. The components selection criteria dialog box appears. Enter the reference
designator of the components that you want to place in the appropriate text box, and click
ok. Drag the components to desired location, place it there.
21
Conductor Routing in Layout:After placing all the components the other main step is to route the board from the
electrical connections between the components. One may route board manually or
automatically by auto router.
100% auto routing can be achieved only when components are placed in the order of
functional flow of electronic circuit. The main routing tool available in OrCad is as flow: Add/edit route mode
Edit segment mode
Shove track mode
Design Rule Check:In manual designs every thing was checked as a possible source of error. Components
sizes, hole sizes, conductor widths and clearance, land-to-hole-ratio, board areas to be free
of components, clearance to the edges, positional accuracy and of course electrical
interconnections had tad to be personally reviewed with a great deal of care. After
completing the design of printed circuit board with the help of an EDA-Tool, a designer
has again to verify the PCB in order to find out errors. Such type of verifications/design
rule check contains beside the general verifications commonly two types: Physical verification
Electrical verification
Post processing:Post processing can be done once the design is completed in all aspects. The common way
is still a process to generate GERBER data and NCD files which can be used for photo
plotting and for steps of CNC manufacturing and PCB- drilling.
22
produce positive and constant voltage. Some of them are given below:23
S. no.
Name of regulator
Output voltage
1
LM 7805
5v
2
LM 7810
10v
3
LM 7812
12v
4
LM 7815
15v
These regulators are used according to the required voltage need.
Constant negative voltage regulators:- These are also the constant output voltage regulator
but there output is negative in polarity. These regulators are also employed according to
voltage requirements. Some of them are given below with there outputs:S. no
1
2
3
4
Name of regulator
LM7905
LM7910
LM7912
LM7915
Output voltage
-5v
-10v
-12v
-15v
Variable voltage regulators:- These are the regulator whose output voltage can be varied
according to the desired need. These regulators again of two types i.e.: Positive
Negative
The output of these regulators can be varied by varying the resistance of the variable
resistance which is connected to the adjustable pin the regulators. So these are the most
commonly used regulators in the electronic industry as wide range of stable voltage can be
obtained from single chip by varying the resistance connected to the adjustable pin of the
regulators. The most commonly variable regulators are: LM317 (it is positive regulator)
LM 337(it is negative regulator)
There description is given below:24
25
U1
3
V IN
VOUT
2
VOUT
ADJ
VIN
L M 3 1 7 /C Y L
R1
220E
C1
.1 u F
R2
5k
Features
1. Guaranteed 1% output voltage tolerance (LM317A)
2. Guaranteed max. 0.01%/V line regulation (LM317A)
3. Guaranteed max. 0.3% load regulation (LM317)
4. Guaranteed 1.5A output current
5. Adjustable output down to 1.2V
6. Current limit constant with temperature
7. P+ Product Enhancement tested
8. 80 dB ripple rejection
9. Output is short-circuit protected
Packages of LM317
26
C2
.1 u F
Application Hints:
In operation, the LM317 develops a nominal 1.25V reference voltage, VREF, between the
output and adjustment terminal. The reference voltage is impressed across program resistor
R1 and, since the voltage is constant, constant current I1 then flows through the output set
resistor R2, giving an output voltage of
PROTECTION DIODES:When external capacitors are used with any IC regulator it is sometimes necessary to add
protection diodes to prevent the capacitors from discharging through low current points
into the regulator. Most 10F capacitors have low enough internal series resistance to
deliver 20A spikes when shorted. Although the surge is short, there is enough energy to
damage parts of the IC. When an output capacitor is connected to a regulator and the input
is shorted, the output capacitor will discharge into the output of the regulator. The
discharge current depends on the value of the capacitor, the output voltage of the regulator,
and the rate of decrease of VIN. In the LM317, this discharge path is through a large
junction that is able to sustain 15A surge with no problem. This is not true of other types of
28
positive regulators. For output capacitors of 25F or less, there is no need to use diodes.
The bypass capacitor on the adjustment terminal can discharge through a low current
junction. Discharge occurs when either the input or output is shorted. Internal to the
LM317 is a 50r esistor which limits the peak discharge current. No protection is needed
for output voltages of 25V or less and 10F capacitance. Figure 3 shows an LM317 with
protection diodes included for use with outputs greater than 25V and high values of output
capacitance.
29
LM337
General Description:
The LM337 is adjustable 3-terminal negative voltage regulators capable of supplying in
excess of 1.5A over an output voltage range of 1.2V to 37V. These regulators are
exceptionally easy to apply, requiring only 2 external resistors to set the output voltage and
1 output capacitor for frequency compensation. The circuit design has been optimized for
excellent regulation and low thermal transients. Further, the LM337 series features internal
current limiting, thermal shutdown and safe-area compensation, making them virtually
blowout-proof against overloads. The LM337 serves a wide variety of applications
including local on-card regulation, programmable-output voltage regulation or precision
current regulation. The LM337 are ideal complements to the LM317 adjustable positive
regulators.
Pin diagram
30
Features:
1) Output voltage adjustable from 1.2V to 37V
2) 1.5A output current guaranteed, 55C to +150C
3) Line regulation typically 0.01%/V
4) Load regulation typically 0.3%
5) Excellent thermal regulation, 0.002%/W
6) 77 dB ripple rejection
7) Excellent rejection of thermal transients
8) Temperature-independent current limit
9) Internal thermal overload protection
10) Standard 3-lead transistor package
11) Output is short circuit protected.
These two Ic's i.e. LM337and LM317are mainly used in the regulated power supplies
because using these regulator a wide range of output can be obtain which can be varied
from 0v to 30v, which is much sufficient to drive any electronic circuit.
31
1
L1
U5
L M 3 1 7 /TO 2 2 0
3
IN D U C T O R A U D IO _ 0
3
2
1
J7
AD J
V IN V O U T
VS
4
5
6
D3
CON3
1
R
C 11
R 14
POT
C 13
R 13
R 15
C 15
R
R 16
1K 1W
10uF 25V T A N T
C 16
CAP
U6
R 17
V IN
VOUT
L2
AD J
2200uF 50V
CAP
470uF 50V
CON3
C 14 C 17
104
1K 1W
R 12
470uF 50V
1
2
3
C 10
R 11
104
10uF 25V T A N T
C 12
J8
R9
C9
BR1
B R ID G E
R 10
POT
1N 4007
C8
-V S
R8
2200uF 50V
1N 4007
D4
L M 3 3 7 /T O 2 2 0
1
2
D5
1N 4007
32
1
2
3
6
5
4
-V S
1
2
3
IN D U C T O R A U D IO _ 0
EMBEDDED SYSTEM
33
DISADVANTAGES OF MICROPROCESSORS
OVER MICROCONTROLLERS
System designed using Microprocessors are bulky
They are expensive than Microcontrollers
We need to add some external devices such as PPI chip, Memory,
Timer/counter chip, Interrupt controller chip,etc. to make it functional.
34
Quantity
4K bytes
128 bytes
2
32
1
6
35
36
37
38
39
There are four ports P0, P1, P2 and P3 each use 8 pins, making them 8-bit ports. All the
ports upon RESET are configured as output, ready to be used as output ports. To use any of
these ports as an input port, it must be programmed.
Port 0:- Port 0 occupies a total of 8 pins (pins 32-39) .It can be used for input or output. To
use the pins of port 0 as both input and output ports, each pin must be connected externally
to a 10K ohm pull-up resistor. This is due to the fact that P0 is an open drain, unlike P1,
P2, and P3.Open drain is a term used for MOS chips in the same way that open collector is
used for TTL chips. With external pull-up resistors connected upon reset, port 0 is
configured as an output port. For example, the following code will continuously send out
to port 0 the alternating values 55H and AAH
Port 0 as input:- With resistors connected to port 0, in order to make it an input, the port
must be programmed by writing 1 to all the bits. In the following code, port 0 is configured
first as an input port by writing 1's to it, and then data is received from the port and sent to
40
P1.
example, the following code will continuously send out to port1 the alternating values 55h
& AAh
Port 1 as input:-To make port1 an input port, it must be programmed as such by writing 1
to all its bits. In the following code port1 is configured first as an input port by writing 1s
to it, then data is received from the port and saved in R7 ,R6 & R5.
Port 2 :-Port 2 occupies a total of 8 pins (pins 21- 28). It can be used as input or
output. Just like P1, P2 does not need any pull-up resistors since it already has pull-up
resistors internally. Upon reset,Port 2 is configured as an output port. For example, the
following code will send out continuously to port 2 the alternating values 55h and AAH.
That is all the bits of port 2 toggle continuously.
Port 2 as input:- To make port 2 an input, it must programmed as such by writing 1 to all
its bits. In the following code, port 2 is configured first as an input port by writing 1s to it.
Then data is received from that port and is sent to P1 continuously.
Dual role of port 2:- In systems based on the 8751, 8951, and DS5000, P2 is used as
simple I/O. However, in 8031-based systems, port 2 must be used along with P0 to provide
the 16-bit address for the external memory. As shown in pin configuration 8051, port 2 is
also designed as A8-A15, indicating the dual function. Since an 8031 is capable of
accessing 64K bytes of external memory, it needs a path for the 16 bits of the address.
While P0 provides the lower 8 bits via A0-A7, it is the job of P2 to provide bits A8-A15 of
the address. In other words, when 8031 is connected to external memory, P2 is used for the
upper 8 bits of the 16 bit address, and it cannot be used for I/O.
42
Port 3:- port 3 occupies a total of 8 pins, pins 10 through 17. It can be used as input or
output. P3 does not need any pull-up resistors, the same as P1 and P2 did not. Although
port 3 is configured as an output port upon reset. Port 3 has the additional function of
providing some extremely important signals such as interrupts. This information applies
both 8051 and 8031 chips. There functions are as follows:PORT 3
P3.0
P3.1
P3.2
P3.3
P3.4
P3.5
P3.6
P3.7
Function
RxD
TxD
___
Int0
___
Int1
T0
T1
___
WR
___
RD
pin
10
11
12
13
14
15
16
17
P3.5 are used for timers 0 and 1. Finally P3.6 and P3.7 are used to provide the WR and RD
signals of external memories connected in 8031 based systems.
ALE/PROG
Address Latch Enable is an output pulse for latching the low byte of the address during
accesses to external memory. This pin is also the program pulse input (PROG) during Flash
programming. In normal operation, ALE is emitted at a constant rate of 1/ 6 the oscillator
frequency and may be used for external timing or clocking purposes. Note, however, that
one ALE pulse is skipped during each access to external data memory. If desired, ALE
operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is
active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled
high. Setting the ALE-disable bit has no effect if the microcontroller is in external
execution mode.
PSEN
Program Store Enable is the read strobe to external program memory. When the
AT89S8252 is executing code from external program memory, PSEN is activated twice
each machine
43
cycle, except that two PSEN activations are skipped during each access to external data
memory.
EA/VPP
External Access Enable. EA must be strapped to GND in order to enable the device to fetch
code from external program memory locations starting at 0000H up to FFFFH. Note,
however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA
should be strapped to VCC for internal program executions. This pin also receives the 12volt programming enable voltage (VPP) during Flash programming when 12-volt
programming is selected.
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating circuit.
XTAL2
Output from the inverting oscillator amplifier.
AT89s8252
AT89S8252 is an ATMEL controller with the core of intel MCS-51. It has same pin
configuration as give above.
The AT89S8252 is a low-power, high-performance CMOS 8-bit microcomputer with 8K
bytes of Downloadable Flash programmable and erasable read only memory and 2K bytes
of EEPROM. The device is manufactured using Atmels high density nonvolatile memory
technology and is compatible with the industry standard 80C51 instruction set and pinout.
The on-chip Downloadable Flash allows the program memory to be reprogrammed insystem through an SPI serial interface or by a conventional nonvolatile memory
programmer. By combining a versatile 8-bit CPU with Downloadable Flash on a
monolithic chip, the Atmel AT89S8252 is a powerful microcomputer which provides a
highly flexible and cost effective solution to many embedded control applications. The
AT89S8252 provides the following standard features: 8K bytes of Downloadable Flash, 2K
bytes of EEPROM, 256 bytes of RAM, 32 I/O lines, programmable watchdog timer, two
Data Pointers, three 16-bit timer/counters, a six-vector two-level interrupt architecture, a
full duplex serial port, on-chip oscillator, and clock circuitry. In addition, the AT89S8252 is
designed with static logic for operation down to zero frequency and supports two software
selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM,
timer/counters, serial port, and interrupt system to continue functioning. The Power Down
Mode saves the RAM contents but freezes the oscillator, disabling all other chip functions
until the next interrupt or hardware reset.
The Downloadable Flash can be changed a single byte at a time and is accessible through
the SPI serial interface. Holding RESET active forces the SPI bus into a serial
programming interface and allows the program memory to be written to or read from
unless Lock Bit 2 has been activated.
44
Features
Compatible with MCS-51Products
8K bytes of In-System Reprogrammable Downloadable Flash Memory
- SPI Serial Interface for Program Downloading
- Endurance: 1,000 Write/Erase Cycles
2K bytes EEPROM
- Endurance: 100,000 Write/Erase Cycles
4.0V to 6V Operating Range
Fully Static Operation: 0 Hz to 24 MHz
Three-Level Program Memory Lock
256 x 8 bit Internal RAM
32 Programmable I/O Lines
Three 16 bit Timer/Counters
Nine Interrupt Sources
Programmable UART Serial Channel
SPI Serial Interface
Low Power Idle and Power Down Modes
Interrupt Recovery From Power Down
Programmable Watchdog Timer
Dual Data Pointer
Power Off Flag
Pin Description
Furthermore, P1.4, P1.5, P1.6, and P1.7 can be configured as the SPI slave port select, data
input/output and shift clock input/output pins as shown in the following table.
45
Port 1 also receives the low-order address bytes during Flash programming and
verification.
cycle, except that two PSEN activations are skipped during each access to external data
memory.
EA/VPP
External Access Enable. EA must be strapped to GND in order to enable the device to fetch
code from external program memory locations starting at 0000H up to FFFFH. Note,
however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA
should be strapped to VCC for internal program executions. This pin also receives the 12volt programming enable voltage (VPP) during Flash programming when 12-volt
programming is selected.
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating circuit.
XTAL2
Output from the inverting oscillator amplifier.
Hardware interfacings and programming
There are two types of programming language used for microcontroller programming:
1)Low Level Language(Assembly Language)
2) High Level Language(C Language)
mnemonic
[operands]
[;comment]
Brackets indicates that a field is optional,and not all lines have them.Bracket should
not be typed in.
1.The label field allows the program to refer to a line of code by name.the label field can
not exceed a certain no. of characters.
2.The assembly language mnemonics(instruction) and operands fields together perform the
real work of the program and accomplish the tasks for which the program was written.
3.The comment field begins with a ;. Comments may be at the and of a line or on a line
by themselvess .
8051 basic instructions:
we describe the basic instructions of the 8051 and
give their formats with some examples.
1).arithmetic instructions
2).logical instructions
3).jump,loop,call instructions
arithmetic instructions:
the arithmetic instructions are used to perform arithmetic
operations like addition,subtraction ,multiplication, division etc.
1)ADD:- this instruction is used to add 2 operands.the 1 operand should be in accumulator
and 2 in the other register.
eg.
MOV R0,#20
MOV A,#10
ADD A,R0
MOV P1,A
Here,# is used to load immediate value and we observe the final value on port 1.
eg.
MOV R0,#20
MOV A,#10
MUL AB
MOV P1,A
Here,# is used to load immediate value and we observe the final value on port 1.
MOV A,#35H
ANL A,#0FH
;A=35H
;A AND 0FH(now A=05)
According to this operation, the content 35H gets ANDing with 0FH.
2).
MOV A,#04
ORL A,#30H
;A=04
;A=A OR 30H(now A=34H)
According to this operation, the content 35H gets ANDing with 0FH.
Jump,loop,call instructions:
the Jump,loop,call instructions are used to perform logical
operations in the sequence of instructions to be executed ,it is often necessary to transfer
program control to a different location.
49
We have used high level language for microcontroller programming due to its given
advantages over assembly:
Advantages of C over Assembly language programming:
Details like register allocation and addressing of memory and data is managed by the
compiler.
Programs get a formal structure and can be divided into separate functions.
Programming and program test time is drastically reduced, this increases efficiency.
Keywords and operational functions can be used that come closer to how humans
think.
The supplied and supported C libraries contain many standard routines such as
numeric conversions.
Reusable code: Existing program parts can be more easily included into new
programs, because of the comfortable modular program construction techniques.
The C language based on the ANSI standard is very portable. Existing programs can
be quickly adapted to other processors as needed.
Actually, only 5 interrupts are available to the user in the 8051, but many manufacturers
data sheets state that there are 6 interrupts since they include reset. The 6 interrupts in the
8051 are allocated as follows:
1).Reset: when the reset pin is activated, the 8051 jumps to address location 0000.this is
the power-up reset.
2).Two interrupts are set aside for the timers:
One for timer 0 and one for timer 1.memory locations 000BH and 001BH in the interrupt
vector table belong to timer0 and timer1, respectively.
3).Two interrupts are set aside for hardware external hardware interrupts. Pin numbers
12(p3.2) and 13(p3.3) in port 3 are the external hardware interrupts INT0 and INT1,
respectively. These external interrupts are also referred to as EX1 and EX2.
4).Serial communication has a single interrupts that belongs to both receive and transmit.
ELECTROMAGNETIC RELAYS
A relay is an electrically controllable switch widely used in industrial controls, automobiles
and appliances. It allows the isolation of two separate sections of a system with two
different voltage sources. The electromechanical (or electromagnetic) relay (EMR) has 3
components: the coil, spring and contacts. When current flows through the coil, a magnetic
field is created around the coil (the coil is energized) which causes the armature to be
attracted to the coil. The armatures contact acts like a switch and closes or opens a circuit.
When the coil is not energized, a spring pulls the armature to its normal state of open or
closed.
In choosing a relay, the following characteristics need to be considered:
1)
2)
3)
51
Q 14
R 62
VCC
31
Y8
E A /V P P
33pF C 45
U 10
1 2
4
3
33pF C 46
19
18
9
12
13
14
15
VC C
XTA L1
XTA L2
R ST
VCC
8 M hz
P 0 .0 /A D
P 0 .1 /A D
P 0 .2 /A D
P 0 .3 /A D
P 0 .4 /A D
P 0 .5 /A D
P 0 .6 /A D
P 0 .7 /A D
330E
LE D
Q 15
C 48
104
R 61
BC 547A
40
VC CVC C
D 29
0
1
2
3
4
5
6
7
P 3 .2 /IN T 0
P 3 .3 /IN T 1 P 2 .0 /A 8
P 3 .4 /T 0
P 2 .1 /A 9
P 3 .5 /T 1
P 2 .2 /A 1 0
P 2 .3 /A 1 1
P 2 .4 /A 1 2
P 2 .5 /A 1 3
P 2 .6 /A 1 4
P 2 .7 /A 1 5
39
38
37
36
35
34
33
32
D 28
330E
LE D
R 41
BC 547A
D 27
330E
LE D
VCC
Q 16
21
22
23
24
25
26
27
28
VCC
Q 17
R 40
BC 547A
D 26
VCC
C 47
1 0 u F /1 6 V
P 3 .7 /R D
P 1 .0 /T 2
P 3 .6 /W R
P 1 .1 /T 2 -E X
PSEN
P 1 .2
A L E /P R O G
P 1 .3
P 3 .1 /TXD
P 1 .4 /S S P 3 .0 /R X D
P 1 .5 /M O S I
P 1 .6 /M IS O
P 1 .7 /S C K
17
16
29
30
11
10
GND
R7
10K
1
2
3
4
5
6
7
8
330E
Q 18
BC 547A
LE D
D 25
R 63
VCC
330E
LE D
Q 19
BC 547A
D 24
20
AT89S8252
R 39
VCC
330E
LE D
Q 20
BC 547A
D 23
R 38
330E
LE D
VCC
Q 21
BC 547A
R 37
330E
D 22
LE D
T it le
< T it le >
S iz e
D ocum ent N um ber
C u s to m< D o c >
D a te :
52
R ev
<R ev C ode>
S heet
of
delay(0xffff);
P2_2=0;
P2_3=1;
delay(0xffff);
P2_3=0;
P2_4=1;
delay(0xffff);
P2_4=0;
P2_5=1;
delay(0xffff);
P2_5=0;
P2_6=1;
delay(0xffff);
P2_6=0;
P2_7=1;
delay(0xffff);
P2_7=0;
P2_0=1
}
}
void delay(unsigned int i)
{
while (i!=0)
{
i--;
}
}
2) Hardware interfacing of LCD(JHD162A):
On most displays, the pins are numbered on the LCDs printed circuit board, but if not, it is
quit easy to locate pin1. Since the pin is connected to ground, it often has a thicker PCB
track connected to it, and it is generally connected to the metal work at some point.
54
The function of each of the connections is shown in the table below:Pins 1 & 2 are the power supply lines, Vss & Vdd. The Vdd pin should be connected to the
positive supply & Vss to the 0V supply or ground.
Although the LCD module data sheets specify 5V D.C. supply (at only a few milliamps),
supplies of 6V & 4.5V both work well, and even 3V is sufficient for some modules.
Consequently, these modules can be effectively and economically powered by batteries.
Pin 3 is a control pin, Vee, which is used to alter the contrast of the display. Ideally, these pin
should be connected to a variable voltage supply. A preset potentiometer connected between
the power supply lines, with its wiper connected to the contrast pin is suitable in many cases,
but be aware that some modules may require a
negative potential; as low as 7V in some cases. For absolute simplicity, connecting this pin to
0V will often suffice.
Pin 4 is register select (RS) line.
PIN NO.
1
2
3
NAME
Vss
Vdd
Vee
FUNCTION
Ground
+ve supply
contrast
55
4
5
6
7
8
9
10
11
12
13
14
RS
R/W
E
D0
D1
D2
D3
D4
D5
D6
D7
Register select
Read/Write
Enable
Data Bit 0
Data Bit 1
Data Bit 2
Data Bit 3
Data Bit 4
Data Bit 5
Data Bit 6
Data Bit 7
Three command control inputs. When this line is low, data bytes transferred to the
display are treated as commands, and data bytes read from the display indicate its
status. By setting the RS line high, character data can be transferred to and from the
module.
Pin 5 is (R/W) line. This line is pulled low in order to write commands or character data
to the module, or pulled high to read character data or status information from its
registers.
Pin 6 is Enable (E) line. This input is used to initiate the actual transfer of commands or
character data between the module and the data lines. When writing to the display, data
is transferred only on the high to low transition of this signal. However, when reading
from the display, data will become available shortly after the low to high transition and
remain available until the signal falls low again.
Pins 7 to 14 are the eight data bus lines (D0 to D7). Data can be transferred to and from
the display, either as a single 8-bit byte or as two 4-bit nibbles. In the latter case, only
the upper four data lines (D4 to D7) are used. This $-bit mode is beneficial when using
a microcontroller, as fewer I/O lines are required.
56
LC D
12
4
3
33pF
C 2
19
18
9
12
15
VC C
E A /V P P
Y 1
XTA L1
XTA L2
R ST
P 1 .0 /T2
P 1 .1 /T 2 -E X
P 1 .2
P 1 .3
P 1 .4 /S S
P 1 .5 /M O S I
P 1 .6 /M IS O
P 1 .7 /S C K
P 3 .2 /IN T 0 P 3 .3 /IN T 1
P 3 .4 /T0
P 2 .0 /A 8
P 2 .1 /A 9
P 2 .2 /A 1 0
P 2 .3 /A 1 1
P 2 .4 /A 1 2
P 2 .5 /A 1 3
P 2 .6 /A 1 4
P 2 .7 /A 1 5
P
P
P
P
P
P
P
P
0 .7 /A
0 .6 /A
0 .5 /A
0 .4 /A
0 .3 /A
0 .2 /A
0 .1 /A
0 .0 /A
AT89S52
D
D
D
D
D
D
D
D
7
6
5
4
P 3 .7 /R D
3
P 3 .6 /W R
2
PSEN
1 A L E /P R O G
0 P 3 .0 /R XD
P 3 .1 /T XD
G N D
32
33
34
35
36
37
38
39
13
14
RS
EN
21
22
23
24
25
26
27
28
17
16
29
30
10
11
20
R 1
10K
1
2
3
4
5
6
7
8
P 3 .5 /T1
VC C
C 3
10uF 16V
56E
40
U 1
31
VC C
33pF C 1
R 52
VC C
VC C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
J2
while(1)
{
cursor_position(0x01);
display('N');
cursor_position(0x02);
display('E');
cursor_position(0x03);
display('T');
cursor_position(0x04);
display('M');
cursor_position(0x05);
display('A');
cursor_position(0x06);
display('X');
}
}
void delay (unsigned int i)
{
while (i!=0)
{
i--;
}
}
void lcd_cmd(unsigned char a)
{
wait();
LCDPRT=a;
RS=0;
EN=1;
EN=0;
}
void display(unsigned char b)
{
wait ();
LCDPRT=b;
RS=1;
EN=1;
58
EN=0;
}
void wait(void)
{
unsigned int count=300;
while(count!=0)
{
count--;
}
}
void Init_lcd(void)
{
lcd_cmd(0x3c);
lcd_cmd(0x0c);
lcd_cmd(0x06);
lcd_cmd(0x01);
}
void clear_lcd(void)
{
lcd_cmd(0x01);
}
void cursor_position(unsigned char c)
{
lcd_cmd(c+0x80);
}
C code for string display on LCD:
#include<at89s8252.h>
#define LCDPRT P1
#define RS P3_3
#define EN P3_4
code unsigned char name_arry[]={"NETMAX$"};
void display_string(unsigned char *sp);
void lcd_cmd(unsigned char a);
void display(unsigned char b);
void wait(void);
void Init_lcd(void);
59
while(count!=0)
{
count--;
}
}
void Init_lcd(void)
{
lcd_cmd(0x3c);
lcd_cmd(0x0c);
lcd_cmd(0x06);
lcd_cmd(0x01);
}
void cursor_position(unsigned char c)
{
lcd_cmd(c+0x80);
}
Features
80C48 and 80C80/85 Bus Compatible - No Interfacing Logic Required
Conversion Time < 100s
Easy Interface to Most Microprocessors
Differential Analog Voltage Inputs
61
PIN DIAGRAM
62
1
3
2
1
1
1
1
0
9
6
0
7
D
D
D
D
D
D
D
D
VC C
VC C
R 6
220E
VC C
P
P
P
P
P
P
P
P
0 .7
0 .6
0 .5
0 .4
0 .3
0 .2
0 .1
0 .0
P
A
P
P
P
P
3 .1 /T XD
L E /P R O G
15
SEN
P 3 .5 /T 1
3 .6 /W R
P 3 .2 /IN T 0 1 2
3 .0 /R XD
3 .7 /R D
A T89S 8252
R 53
1k
7
6
5
4
3
2
1
0
U 4
AD C 0804
P
P
P2
P2
P2
P2
P2
P2
2 .0 /A
2 .1 /A
.2 /A 1
.3 /A 1
.4 /A 1
.5 /A 1
.6 /A 1
.7 /A 1
8
9
0
1
2
3
4
5
2
2
2
2
2
2
2
2
1
2
3
4
5
6
7
8
1
1
1
1
1
1
1
1
EOC
8
7
6
5
4
3
2
1
5
SOC
D
D
D
D
D
D
D
D
B
B
B
B
B
B
B
B
0
1
2
3
4
5
6
7
+ IN
-IN
V R E F /2
C LK R
C L K IN
IN T R
C S
R D
W R
C 9
C AP
6
7
P 3 .3 /IN T 1
P 3 .4 /T 0
/A
/A
/A
/A
/A
/A
/A
/A
VC C
1
R 5
10K
R ST
G N D
O U TPU T
G N D
R 2
10K
2
3
4
5
6
7
8
9
XTA L1
XTA L2
1
2
3
4
5
6
7
8
20
3
3
3
3
3
3
C 6
3
10uF 16V 3
U 2 2 L M 3 5 /S O
U 21
TL431
9
19
4
1
2
3
10
VC C
13
14
R 55
56E
V C C /V R E F
R S
EN
EN
AG N D
C 5
R S
33pF
19
18
G N D
P 1 .0 /T 2
P 1 .1 /T 2 -E X
P 1 .2
P 1 .3
P 1 .4 /S S
P 1 .5 /M O S I
P 1 .6 /M IS O
P 1 .7 /S C K
20
12
VC C
E A /V P P
33pF C 4
Y 2
VC C
U 2
31
C R Y S TA L
C 13
104
40
VC C VC C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
LC D
C 8
1 u f /1 6 v
R 17
10K
C 7
150pF
Temprature monitoring
system
controller to read the data, otherwise controller can not read the data.
is always grounded.
is software controlled.
C 14
1 u f /16 v
P
P
P
P
3
3
3
3
.2
.3
.4
.5
/IN T 0
/IN T 1
/T 0
/T 1
VC C
C 18
10uF 16V
R 4
10K
1
2
3
4
5
6
7
8
P
P
P
P
P
P
P
P
1
1
1
1
1
1
1
1
.0
.1
.2
.3
.4
.5
.6
.7
P
P
P2
P2
P2
P2
P2
P2
D
D
D
D
D
D
D
D
0
1
2
3
4
5
6
7
2 .0 /A
2 .1 /A
.2 /A 1
.3 /A 1
.4 /A 1
.5 /A 1
.6 /A 1
.7 /A 1
8
9
0
1
2
3
4
5
P 3 .7 /R D
/T 2
P 3 .6 /W R
/T 2 -E X
PSEN
A L E /P R O G
P 3 .1 /TXD
/S S
P 3 .0 /R X D
/M O S I
/M IS O
/S C K
AT89S8252
39
38
37
36
35
34
33
32
21
22
23
24
25
26
27
28
17
16
29
30
11
10
U 6
C 23
104
VC C
J7
16
R ST
/A
/A
/A
/A
/A
/A
/A
/A
11
12
7
8
1 0 U F /1 6 V
C 20
1
3
2
VC C
C 21
1 0 U F /1 6 V
66
T 1 IN
R 1O U T
T2O U T
R 2 IN
C 1+
C 1V+
VC C
9
12
13
14
15
XTA L1
XTA L2
.0
.1
.2
.3
.4
.5
.6
.7
R 1 IN
T1O U T
T 2 IN
R 2O U T
G N D
19
18
0
0
0
0
0
0
0
0
15
3
C 17
P
P
P
P
P
P
P
P
G N D
12
33pF
40
E A /V P P
Y 4
VC C
U 5
C 19
104
20
C R Y S TA L
33pF C 16
31
VC C VC C
C 2+
C 2VM A X232
13
14
10
9
SPT TXD
1
2
3
SPT RXD
C 2 4 1 0 U F /1 6 V
4
5
6
1 0 U F /1 6 V
C 22
S E R IA L P O R T O F P C
}
void transmit_serial(unsigned char a)
{
SBUF=a;
delay(500);
TI=0;
}
void delay(unsigned int i)
{
while(i!=0)
{
i--;
}
}
b)Serial Reception(From PC to microcontroller)
J3
LC D
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
NETMAX
EN
R 54
VC C
R S
VC C
56E
VC C VC C
2
3
4
5
6
7
8
9
R ST
P
P
P
P
P
P
P
P
P
P
P
P
3
3
3
3
0
0
0
0
0
0
0
0
.2
.3
.4
.5
.7
.6
.5
.4
.3
.2
.1
.0
/IN T 0
/IN T 1
/T 0
/T 1
/A
/A
/A
/A
/A
/A
/A
/A
D
D
D
D
D
D
D
D
R 8
10K
7
6
5
4
3
2
1
0
P
P
P2
P2
P2
P2
P2
P2
2 .0 /A
2 .1 /A
.2 /A 1
.3 /A 1
.4 /A 1
.5 /A 1
.6 /A 1
.7 /A 1
8
9
0
1
2
3
4
5
P 3 .7 /R D
P 3 .6 /W R
PSEN
A L E /P R O G
P 3 .1 /T XD
P 3 .0 /R XD
2
2
2
2
2
2
2
2
1
1
2
3
1
1
1
2
3
4
5
6
7
8
7
6
9
0
1
0
U 12
11
12
1 0 U F /1 6 V
7
8
C 51
1
3
2
VC C
AT89S8252
C 54
104
VC C
J8
16
3
3
3
3
3
3
C 49
3
10uF 16V 3
2
3
4
5
C 52
1 0 U F /1 6 V
68
T 1 IN
R 1O U T
VC C
VC C
1
1
1
1
T2O U T
R 2 IN
C 1+
C 1V+
R 1 IN
T1O U T
T 2 IN
R 2O U T
G N D
R S
EN
XTA L1
XTA L2
1
2
3
4
5
6
7
8
15
C 35
G N D
33pF
19
18
P 1 .0 /T 2
P 1 .1 /T 2 -E X
P 1 .2
P 1 .3
P 1 .4 /S S
P 1 .5 /M O S I
P 1 .6 /M IS O
P 1 .7 /S C K
20
12
VC C
E A /V P P
33pF C 34
Y 9
40
U 11
31
C R Y S TA L
C 50
104
C 2+
C 2VM A X232
13
14
10
9
SPT TXD
1
2
3
SPT RXD
C 5 5 1 0 U F /1 6 V
4
5
6
1 0 U F /1 6 V
C 53
S E R IA L P O R T O F P C
PCON=PCON&0x7F;
TMOD=TMOD&0x0F;
TMOD=TMOD|0x20;
TH1=0xfd;
SCON=0X50;
TR1=1;
}
void delay (unsigned int i)
{
while (i!=0)
{
i--;
}
}
void lcd_cmd(unsigned char a)
{
wait();
LCDPRT=a;
RS=0;
EN=1;
EN=0;
}
void display(unsigned char b)
{
wait ();
LCDPRT=b;
RS=1;
EN=1;
EN=0;
}
void wait(void)
{
unsigned int count=300;
while(count!=0)
{
70
count--;
}
}
void Init_lcd(void)
{
lcd_cmd(0x3c);
lcd_cmd(0x0C);
lcd_cmd(0x06);
lcd_cmd(0x14);
lcd_cmd(0x1C);
lcd_cmd(0x01);
}
void cursor_position(unsigned char d)
{
lcd_cmd(d+0x80);
}
C 48
1 0 u F /1 6 V
R 36
10K
1
2
3
4
5
6
7
8
P
P
P
P
P
P
P
P
1
1
1
1
1
1
1
1
.0
.1
.2
.3
.4
.5
.6
.7
P 3 .7 /R D
/T 2
P 3 .6 /W R
/T 2 -E X
P 3 .5 /T 1
P 3 .4 /T 0
P 3 .3 /IN T 1
/S S
P 3 .2 /IN T 0
/M O S I P 3 .1 /T XD
/M IS O P 3 .0 /R XD
/S C K
A T89S 8252
7
6
5
4
3
2
1
0
0
0
0
0
0
0
E
E
E
E
E
E
6
2
1
7
8
7
6
5
4
3
2
VC C
LT
B I/R B O
R BI
D
D
D
D
3
2
1
0
U 12
74LS47
71
c
d
VC C
1 0 k S IP
VC C
3
4
5
20
19
18
17 VC C
16
15
14
13
12
11
1
1
1
1
1
1
1
1
22
22
22
22
22
22
VC C
R 11
VC C
7
8
9
15
19
21
g
f
G /V
a
b
g
f
G /v
a
b
1
2
3
4
5
6
7
8
R
R
R
R
R
R
220E
2
2
2
2
2
2
2
2
74LS47
U 3
R 3
B
A
F
G
E
D
C
12
13
15
14
9
10
11
R 13 220E
R
R
R
R
R
1
1
2
2
2
4
6
0
4
5
R 34
22
22
22
22
22
e
d
G /V
c
dot
e
d
G /V
dot
c
2 .0 /A 8
2 .1 /A 9
.2 /A 1 0
.3 /A 1 1
.4 /A 1 2
.5 /A 1 3
.6 /A 1 4
.7 /A 1 5
3
2
1
0
8
7
6
5
4
3
2
0
1
2
3
4
5
6
7
D
D
D
D
16
P
P
P2
P2
P2
P2
A L E /P R O G P 2
PSEN
P2
D
D
D
D
D
D
D
D
6
2
1
7
1
2
3
4
5
6
7
8
12
13
15
14
9
11
10
0
0
0
0
0
E
E
E
E
E
220E
VC C
e d
c
VC C
VC C
R ST
/A
/A
/A
/A
/A
/A
/A
/A
0
0
0
0
0
0
0
0
B
A
F
G
E
C
D
1
2
3
4
5
6
7
8
9
10
30
29
XTA L1
XTA L2
.0
.1
.2
.3
.4
.5
.6
.7
P
P
P
P
P
P
P
P
G N D
0
0
0
0
0
0
0
0
9
8
7
6
5
4
3
2
20
3
33PF
19
18
P
P
P
P
P
P
P
P
3
3
3
3
3
3
3
3
VC C
4
12
C 42
E A /V P P
Y 3
VC C
C 43
G N D
40
U 16
31
8 M hz
33PF
B I/R B O
R BI
LT
4
5
3
9
8
7
6
5
4
3
2
104
G N D
C 49
VC C
16
VC C
VC C
R 37
1 0 k S IP
VC C
1 0 K S IP
VC C
VC C
R 35
U 13
D IP 2 0
}
}
unsigned char read_adc(void)
{
unsigned char n=0;
SOC=0;
SOC=1;
while(EOC==1)
{
n=P2;
}
return n;
}
void dec(unsigned int x)
{
x=(x/10)*6+x;
P0=x;
}
void bcdconv(unsigned int mb)
{
unsigned char x;
unsigned char y;
x=mb&0x0f;
x=x|0x30;
y=mb&0xf0;
y=y>>4;
y=y|0x30;
display(y);
display(x);
}
73
74
75