Download Seminar Report

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Opto-isolator wikipedia , lookup

Rectiverter wikipedia , lookup

Immunity-aware programming wikipedia , lookup

Transcript
INDORE INSTITUTE OF SCIENCE AND TECHNOLOGY
A
Project Report
ON
“ Electronics dice ”
Submitted to “Rajiv Gandhi ProudyogikiVishwavidyalaya,
Bhopal” in the partial fulfillment of the award of the degree of
Bachelor of Engineering
In
Electronics and Communication Engineering
SESSION - 2012
Guided by:
Submitted by:
Department Of Electronics and Instrumentation Engineering
Indore Institute Of science and Technology
Indore (M.P)
INDORE INSTITUTE OF SCIENCE AND TECHNOLOGY
CERTIFICATE
This is to certify that “AJAY COUDHARY, AMBIKA TIWARI, ASHOK
PUNASIA, AYUSH KHANDELWAL ” have successfully completed the
project on “ELCTRONICS DICE ” during year 2012 in partial fulfillment
of the requirement for award of the degree of Bachelor of Engineering
inElectronics and Communication Engineering.
S
Guided By :
Approved By:
Mrs B. Harita
Lecturer
H.O.D
Department of
Department of
Electronics and Communication Electronics and Communication
I.I.S.T, IndoreI.I.S.T, Indore
ACKNOWLEDGEMENT
The completion of any inter disciplinary project depends upon the cooperation, co-ordination, dedication & combine efforts of several resources
of knowledge of time. Therefore, I approach to this important matter of
acknowledgement through this lines & trying my best to give full credit
where it deserves.
I am deeply indebted & highly obliged to Miss. VeenaTiwari for her
valuable encouragement to complete this project. I am sincerely thankful to
her for the guidance provided by her at each & every stage of the project.
We would like to thank our respected faculty Miss. VeenaTiwari(Project Incharge), Mrs. B. Harita(H.O.D. of Elex. & Comm. Engg.)
& Dr. S. R. Lapalikar(Director) who helped us directly or indirectly for
completion of our project. Without their effort & explanation this was not
possible, without giving due credit to them we cannot even think of writing
report.
I would also like to express my special thanks to my friends & colleagues,
helping me throughout this project work. I also thank all the faculties & staff
members of Electronics & Communication Department IIST Indore.
CONTENTS:1. Introduction
2. Block diagram
3.Circuit Diagram
4. Working Principle
5. Component list
 MICROCANTROLLR
 IC 7805
 SEVEN SEGMENT
 SWITCHS
 CAPICITORS
 RESISTERS
6. Design specification
 PCB designing
 Layout designing
7. Software details
8. Hardware details
9. Advantages
10.Limitation
11.Applications
12.Future scope
13.References
14.Conclusion
15. Data sheets
16. Snap of Projects
ABSTRACT
Even today many microcontroller making interfacing with the seven
segment and Lcd display which is appliance in several electronics
devices.
Through the microcontrollers serves the many information like
decorating product, saffosticatedcampus,games zones etc.
The project is attemted to developed a
totally electronically based
system, which provide a better communication between the unknown
sarvent and condition which is applied on that atmosphere. The present
project only helps to indicating the result that’s provided by
microcontroller counting.
INTRODUCATION
This project is basedon the concept is that interfacing microcontroller with
the seven segment display. In this project we made two circuit first one is
based on our main concept to seven segment interfacing the circuit, and
second one circuit is for turning on/off the display by switch appliance or
activate this circuit means it is a reset circuit. We can activate this circuit
from the power supply of 12 volt bettarycircuit from a ic7805 to 5
voltsupply. The 5 volt supply interfaced between the microcontroller and
seven segment generated by connection of port 2 pin which is connected
by serially the reset swicth which placed on the main circuit and activate the
circuit when we push the switch circuit button.
COMPONENT
 Microcontroller (AT89C51)
 Seven segment
 Ic 7805
 Switchs
BLOCK DIAGRAM
Swicth 1
Switch 2
oscillator
Intertfacing circuit
Description of block diagram
Microcontroller(AT89C51):-
Microcon
troller
(AT89C5
1)
Power
sssuppl
y
Seven
segment
display
pin AT89C51, there are four port designated as p1, p2, p3, p0. All these
ports are 8-bit bidirectional port, i.e., they can used as both input and output
ports. Except p0 which needs external pull-ups, rest of the ports have
internal pull-ups.when 1s are written to these port pins, they are pulled high
by the internal pull-ups and can be used as input. These ports are also bit
addressable and so their bit can also be accessed individually.
Flash AT89C51 is an 8-bit microcontroller and belong to
atmel’s 8051 family. ATEL 89C51 has 4KB programmable and erasable
read only memory (PEROM) and 128 bytes of RAM. It can be erased and
program to a maximum of 1000 times.
Seven segment display:-
A seven segment display is most basic electronics display digit from 0-9.
They find wide application in devices that display numeric information like
digital clocks, radio, microwave ovens, electronic meter etc. the most
common configuration has an array of eight led arranged in a special pattern
to display these digit. They are laid out as a squared-off figure ‘8’. Every led
is assigned name from ‘a’ to ‘h’and is identified by its name.seven led ‘a’ to
‘g’ are used to display the numerals while eighth led ‘h’ is used to display
the dot/decimal.
POWER SUPPLY:9V-12V power supply is given to the IC 7805, which convert it into
5Vdc. The power supplies to the entire blocks are different as –
Circuit diagram
working principal:connecting the circuit as diagram then connect the battery power
supplies from 12 volt dc is provided to IC7805 which convert into 5 volt
dc supplies. These supplies go to microcontroller pin no 40 and 31 which
is activate the microcontroller and the pre initiated by the crystal
oscillator. The crystal oscillator work as a filer circuit which is
protecting the microcontroller. Port 2 is serially connecting with the
seven segment. The two switch are using in circuit one for the on\off and
second for reset the circuit. The seven segment in starting time the all
led blow as we press the switch the led display is flactuats and as
pressing is stop the seven segment has taken the values.
These working only for physical components but in
microcontroller we should burn the software programming which is
done by hexadecimal coding for the eight bit frames. The programming
is easily can write in c language.
PCB LAYOUT:-
Component description:IC7805:as fixed voltage regulators, these
devices
Features







Output current up to 1.5 A
Output voltages of 5; 6; 8; 8.5; 9; 12; 15; 18; 24 V
Thermal overload protection
Short circuit protection
Output transition SOA protection
2 % output voltage tolerance (A version)
Guaranteed in extended temperature range (A version)
Description:The L78xx series of three-terminal positiveregulators is available in TO-220,
TO-220FP, TO-3, D²PAK and DPAK packages and several fixed
output voltages, making it useful in a wide rangeof applications. These
regulators can providelocal on-card regulation, eliminating thedistribution
problems associated with single pointregulation. Each type employs internal
currentlimiting, thermal shut-down and safe areaprotection, making it
essentially indestructible. Ifadequate heat sinking is provided, they can
deliver over 1 A output current. Although designedprimarily can be used
with external components toobtain adjustable voltage and currents.
MICROCONTROLLER(AT89C51)
As name implies a controller fabricated in a small scale to control the
devices at hand simultaneously or independently.
A Microcontroller is an entire computer manufactured on a single
chip.Microcontrollers are usually dedicated devices embedded within an
application.For example microcontrollers are used as engine controllers and
as exposure and focus controllers in cameras. In order to serve these
applications they have a high concentration of on chip facilities such as
serial ports, parallel I/O ports, timers, counters, interrupt control, random
access memory read only memory. The I/O memory and on chip peripherals
are selected depending on the specifics of the target application. Since
microcontrollers are powerful digital processors, the degree of control and
programmability they provide significantly enhances the effectiveness of the
application. The design approach of the microcontroller mirrors that of the
microprocessor i.e. to make a single design that can be used in as many
applications possible. The microcontroller is concerned with getting data
from and to its own pins; the architecture and instruction set are optimized to
handle data in bit and byte size.
AT89C51 is a trade name used by its manufacturer (Atmel Corp.)
AT89C51 BASIC FEATURES:•
•
•
•
•
•
•
•
•
•
4 K Bytes ROM.
128 Bytes RAM.
Four 8-bit I/O Ports.
Two 16 Bit Timers.
Serial Interface.
64 K External Code Memory Space.
64 K External Data Memory Space.
Boolean processor (operates on single bits).
210 Bit Addressable Locations.
4 Microseconds Multiply / Divide.
PIN CONFIGURATION OF AT89C51
A BRIEF DESCRIPTION OF PINOUTS OF AT89C51: Pins 1-8 :
Pins 1 through 8 are the pins of Port 1. Port 1 is a dedicated I/O port;
so
these pins are available for interfacing external devices as
required. No alternate function is assigned to these pins.
 Pin 9 :
Pin Number 9 is the system RESET (RST) of CPU of AT89C51.
AT89C51 is reset by holding RST high for at least two machine
cycles
and then returning it low. The Reset may be manually activated using a
switch, or may be activated upon power-up using RC network. After a
system reset, Program Counter is loaded with 0000H. When RST returns
low, program execution begins at the first location in code memory at
address 0000H. The contents of on-chip RAM are not affected by a reset
operation.
Below are the RC networks connected with RST pin:-
 Pins 10-17 :
Pins’ numbers 10 through 17 constitute Port 3 which is a dualpurpose port. As well as general purpose I/O, these pins are multifunctional
with each having an alternate purpose related to special features of C51.
 Pins 18-19 :
Pins’ numbers 18 and 19 comprise the inputs of crystal to be
connected to the on-chip oscillator of AT89C51. Two Stabilizing capacitors
of 30 pF each are also required.
 Pin 20 :
It is the common ground of 89C51 and accompanying networks.
 Pins 21-28 :
Pins 21 through 28 are of Port 2.Port 2 is a also a dual purpose port. It can
serve as a general purpose I/O port or as the high byte of the address bus for
designs with external code memory or more than 128 bytes of data memory.
 Pin 29 and Pin 31 :
These pins are used in conjunction with external code memory being
used or else. On Pin number 29 is a control signal PSEN# (Program Store
Enable) that enables external code (Program) memory. It is usually
connected to an EEPROMs Output Enable(OE#) pin to permit reading of
program bytes. Pin 31 i.e. EA# (External Access) is either tied high (+5V) or
low (ground). If high, the C51 executes programs from internal ROM
otherwise from external code memory (and then PSEN# comes into play).
 Pins 32 - 39 and Pin Number 30:
Pins 32 through 39 make up Port 0. Port 0 , in addition to beingused
as an I/O port, has the capacity to act as multiplexed data and address bus.
The discrimination of data and address is provided through ALE (Address
Latch Enable) which is Pin number 30.
SPECIAL FUNCTION REGISTER MEMORY(SFR):The 8052 is a flexible microcontroller with a relatively large number of
modes of operation. Your program may inspect and/or change the operating
mode of the 8052 by manipulating the values of the Special Function
Registers (SFRs).SFRs are accessed as if they were normal Internal RAM.
The only difference is that Internal RAM is addressed in .direct mode. with
addresses 00h through 7Fh whereas SFR registers are accessed in the range
of 80h through FFh. Each SFR has an address (80h through FFh) and a
name.
SERIAL INTERFACE AT89C51 & ITS REGISTERS:The 89C51 include an on-chip serial port that can operate in several modes
over a wide range of frequencies. The essential functions of the serial port is
to perform parallel-to-serial data conversion for output data, and serial-toparallel conversion for input data. The serial port features Full Duplex
Mode (simultaneous transmission and reception of data).
• Hardware access to the serial port is through TxD and RxD pins
already described in previous section on “Pinouts of 89C51”.Two
SFRs provide software access to serial port viz.., SBUF and SCON.
SBUF at 99H holds the serial data.
A BRIEF DESCRIPTION OF SFRs OF AT89C51:-
Program Control Register
General Purpose Registers
PSW(Program Status Word)
ACC (ACCumulator)
Registers
and
Ports’ Registers
P0, P1, P2 and P3
Data Flow Register
(the only 16 bit register)
DPH and DPL or DPTR(Data
PoinTeR addressable as 16 bit)
Stack Operation Register
SP (Stack Pointer)
Power Control Register
PCON (Power CONtrol)
TCON (Timer CONtrol) ,
B
Timer/Counter Registers
TMOD (Timer MODe),
Timer #0 Registers TL0 & TH0
Timer #1 Registers TL1 & TH1
Serial Interface Registers
SCON (Serial CONtrol)
SBUF (Serial BUFfer)
Interrupt System Registers
IE (Interrupt Enable)
IP (Interrupt Priority)
SCON REGISTER(98h) :Let’s present the "Serial Control" (SCON) SFR and define what each
bit of the SFR represents.The SCON SFR allows us to configure the Serial
Port.
SM0
SM1
SM2
REN
TB8
RB8
TI
RI
Bit
Name
Bit Address
Explanation of Function
7
SM0
9Fh
Serial port mode bit 0
6
SM1
9Eh
Serial port mode bit 1.
5
SM2
9Dh
Serial port mode bit 1.
4
REN
9Ch
Receiver Enable. This bit must be set
in order to receive characters.
3
TB8
9Bh
Transmit bit 8. The 9th bit to transmit
in mode 2 and 3.
2
RB8
9Ah
Receive bit 8. The 9th bit received in
mode 2 and 3.
1
TI
99h
Transmit Flag. Set when a byte has
been completely transmitted.
0
RI
98h
Receive Flag. Set when a byte has
been completely received.
MODES OF SCON REGISTER:-
SM0
SM1
Serial Mode
Explanation
Baud Rate
0
0
0
13-bit Timer
Mode
Oscillator / 12
0
1
1
16-bit Timer
Mode
Set by Timer 1
1
0
2
8-bit Auto-Reload Oscillator / 32
Mode
1
1
3
Split Timer Mode
Set by Timer 1
The program uses mode-1 , 8-bit UART(Universal Asynchronous Receiver
Transmitter) with the receiver enabled.
So SCON becomes :
SCON = 0 1 0 1 0 0 0 0 = 0x50 ;
TIMER SFR’s:
Given microcontroller has three timers,Timer0 ,Timer1 and Timer2.
First two work in the same manner while Timer 2 has a different control
register(T2CON).Timer1 is being used to generate 9600 bps baud rate for
the serial data and Timer 0 is being used to count 20ms time duration for
delay in sending serial data to System processor. The SFRs used to control
and manipulate the timers are presented in the following table.
SFR Name
Description
SFR Adddress
Timer 0 High Byte
8Ch
TH0
Timer 0 Low Byte
8Ah
TL0
Timer 1 High Byte
8Dh
TH1
Timer 1 Low Byte
8Bh
TL1
Timer Control
88h
TCON
Timer Mode
89h
TMOD
Timer 0 has two SFRs dedicated exclusively to itself: TH0 and TL0.
TL0 is the low-byte of the value of the timer while TH0 is the high-byte
of the value of the timer. That is to say, when Timer 0 has a value of 0,
both TH0 and TL0 will contain 0. When Timer 0 has the value 1000
(decimal), TH0 will hold the high byte of the value (3 decimal) and TL0
will contain the low byte of the value (232 decimal).Timer 1 works the
exact same way, but its SFRs are TH1 and TL1.
The individual bits of TMOD(Timer MODe) have the following functions:
TMOD(Timer MODe) SFR (89h):
Bit
Name
Explanation of Function
Timer
When this bit is set the timer will only run when
INT1(P3.3) is high. When this bit is clear the timer
will run regardless of the state of INT1
When this bit is set the timer will count events on
T1(P3.5). When this bit is clear the timer will be
Incremented every machine cycle.
1
7
GATE1
6
C/T1
5
T1M1
Timer mode bit (see below)
1
4
T1M0
1
3
GATE0
2
C/T0
Timer mode bit (see below)
When this bit is set the timer will only run when INT0
(P3.2) is high. When this bit is clear the timer will run
regardless of the state of INT0.
When this bit is set the timer will count events on T0
(P3.4). When this bit is clear the timer will be
incremented every machine cycle.
1
T0M1
Timer mode bit (see below)
0
0
T0M0
Timer mode bit (see below)
0
The four bits given for mode are :
TIMER MODES
Tx M1
Tx M0
Timer Mode
Description
0
0
0
13 - bit Timer
0
1
1
16 - bit Timer
1
0
2
8 -bit auto-reload
1
1
3
Split timer mode
1
0
0
The software uses Timer1 in mode 2, 8 bit reload. Thus the value of TMOD
can be written as:
TMOD= 0 0 1 0 0 0 0 0 b or 0x20;
TH1 = 0xFD;
TH1: reload value for 9.6K baud at 11.059MHz.
Setting the values of TR0 and TR1 will make the corresponding timers
active.
INTERRUPT SFR IE (Interrupt Enable):Various interrupts can be enabled or disabled by modifying the Interupt
Enable Register as :
IE (Interrupt Enable) (A8h) SFR
Bit
7
Name
EA
Bit Address
AFh
Explanation
Global Interrupt Enable/Disable
6
-
AEh
Undefined
5
-
ADh
Undefined
4
ES
ACh
Enable Serial Interrupt
3
ET 1
ABh
Enable Timer 1 Interrupt
2
EX 1
AAh
Enable External 1 Interrupt
1
ET 0
A9h
Enable Timer 0 Interrupt
0
EX 0
A8h
Enable External 0 Interrupt
The program uses timer0 interrupt and serial interrupt,so the IE SFR
becomes: IE = 1 0 0 1 0 0 1 0 = 0x92.
SEVEN SEGMENT:
Seven Segment are available in two configuration - (1) Common
Anode (2) Common Cathode.
Here common anode seven segment display is used because the
output current of the microcontroller is not sufficient enough to drive
the LED’s, similar to the case of driving an LED. The circuit diagram
shows the connections of seven segment to the controller. The pins a
to g of the Seven Segment are connected to the Port P2 of the
microcontroller. The common pin of the seven segment is connected
to Vcc. The ‘h’ has not been used, which is the dot pin of the
controller.
Since the seven segment display works on negative logic, we will
have to provide logic 0 to the corresponding pin to make an LED
glow. Table below shows the hex values used to display the different
digits.
DIGIT
0
1
2
3
4
5
6
7
8
9
a
0
1
0
0
1
0
0
0
0
0
B
0
0
0
0
0
1
1
0
0
0
c
0
0
1
0
0
0
0
0
0
0
d
0
1
0
0
1
0
0
1
0
1
E
0
1
0
1
1
1
0
1
0
1
f
0
1
1
1
0
0
0
1
0
0
g
1
1
0
0
0
0
0
1
0
0
HEX Value
0x40
0xF9
0x24
0x30
0x19
0x12
0x02
0xF8
0x00
0x10
Layout designing
Programming coding in c language
#include<reg51.h>
sbitsw=P1^0;
unsigned char i=0;
void main()
{
unsigned char a[6];
a[0]=0x86;
a[1]=0x0DB;
a[2]=0x0CF;
a[3]=0x0E6;
a[4]=0x0ED;
a[5]=0x0FD;
sw=1;
while(1)
{
if(sw==0)
{
for(i=0;i<=5;i++)
{
P2=a[i];
}
}
}
}
Testing result:
 Output of IC7805 should be 5 volt we get it.
 Port 2 is interfaced with the seven segment we get at both pins
are shorts circuited found.

ADVANTAGES
 It can give the crrect value of the given condition.
 Microcontroller can interface with in many application.

DISADVANTAGES
 It is too complex to interface with the seven segment.
RIFERENCES:1. The 8051 Microcontroller and Embedded Systems.
Muhammad Ali Mazidi
Janice GillispieMazidi
Rolin D. McKinlay
2. The 8051 Microcontroller, Architecture, Programming & Applications
Kenneth J. Ayala
Penram International
3. www.datasheetarchive.com
4. www.bb-elec.com