Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

QUIZ BUZZER USING AT80C51 MICROCONTROLLER

No description
by

Shishir Srikanth

on 25 December 2013

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of QUIZ BUZZER USING AT80C51 MICROCONTROLLER

PIN CONFIGURATION OF AT89C51
PORT 0 (Pin no. 32 - Pin no. 39)
PORT 1 (Pin no. 1 - Pin no. 7)
PORT 2 (Pin no. 21 - Pin no. 28)
PORT 3 (Pin no.10 - Pin no. 17)
XTAL1 and XTAL2 (Pin no. 18 and 19)
RST (Pin no. 9)
EA/VPP (Pin no. 31)
PSEN (Pin no. 29)
ALE (Pin no. 30)
QUIZ BUZZER
The AT89C51 microcontroller is a 40 pin package in which 32 pins can be used for input and output.
We use 8 switches and they are connected individually to port 1 pins and we make a serial line for all the 8 switches so that they can be connected to a buzzer.
We use a 7-Segment display to display the information of the switch which is pressed.
COMPONENTS
REQUIRED
AT89C51 Microcontroller
7-segment display
Piezo buzzer
12MHz Crystal Oscillatot
BC 548
Resistors
Capacitor
Switches
CIRCUIT DIAGRAM
QUIZ BUZZER USING AT89C51 MICROCONTROLLER
Pin 40 provides supply voltage to the IC AT89C51. The voltage source is +5V. Pin 20 is connected to the ground.
Switches are connected through Port P1.0-P1.7 (Pin 1-Pin 8).
A transistor BC548, a current controlled voltage device is used to activate common anode 7-segment display.
EA pin (Pin no. 31) is connected to +5V. EA pin is active low. Internal ROM can be accessed when we connect this pin to high. External ROM can be accessed if it is connected to ground.
Port P3.0 (Pin no. 10) is connected to the Base of the transistor. Initially, this pin is made LOW so that transistor acts as an open switch and 7-segment does not display any output.
When Base is HIGH, transistor works as a closed switch. This allows the flow of voltage from Collector to Emitter which will activate the 7-segment display.
Port P3.1 (Pin no. 11) is used as STOP pin. Now even if any other input is pressed, there will be no effect on the system till the time the STOP pin is pressed to reset the system.
The 8051 has an on chip oscillator but requires an external clock to run it. Most often a quartz crystal oscillator is connected to inputs XTAL1 (pin 19) and XTAL2 (pin 18).
ARCHITECTURE
ALU:
It is 8 bit unit.
Performs arithmetic & logical operations such as addition, subtraction, AND, OR etc.
Contains 34 genera purpose registers and 2 of them are called math reg i.e. Reg A & B.
ACCUMULATOR (A-Register):
It is 8 bit register.
Results of arithmetic and logical operations performed by ALU is accumulated in this register.
Most of the instructions are carried out on accumulator data.
It is most versatile of the two CPU registers.
B-Register:
It is special 8 bit math register.
It is used as general purpose register to store 8 bit data.
PSW:
It is 8 bit register.
It has 4 conditional flags which sets or resets according to condition of result & 3 control flags.
CONDITIONAL FLAGS:
Carry Flag (CY)
Auxiliary Carry Flag (AC)
Overflow Flag (OV)
Parity Flag (P)
CONTROL FLAGS:
FO: It is user defined flag. The user can set,test and clear this flag through software.
RS1 and RS2: These flags are used to select bank of register by resetting those flags.
PROGRAM COUNTER (PC):
It is 2-byte address which tells the 8051 where the next instruction to execute is found in memory.
It is used to hold 16 bit address.
When 8051 is initialized, PC always starts with 0000h.
DATA POINTER REGISTER (DPTR):
It is a 16 bit register used to hold address of external or internal RAM where data is stored or result is to be stored.
It is used to store 16 bit data.
It is divided into two 8-bit registers, DPH & DPL.
Each reg. can be used as general purpose reg to store 8 bit data.
STACK POINTER (SP):
It is 8 bit register.
It is used to hold the internal RAM memory location adress which is used as stack memory.
RAM:
Internal RAM has 128 byte of memory.
It is divided into 3 parts i.e. bank registers, bit addressable and general purpose RAM.
The code for this application is written in such a way that when any input switch is pressed the corresponding switch number is displayed in the 7-segment display.
The microcontroller works on a clock frequency of 12 Mhz.
A seven segment display is the most basic electronic display device that can display digits from 0 to 9.
The most common configuration has an array of 8 LEDs arranged in special pattern to display these digits.
Every LED is assigned a name from ‘a’ to ’h’ and is identified by its name.
Seven LEDs ‘a’ to ‘g’ are used to display the numerals while eighth LED ‘h’ is used to display the Dot/decimal.
A seven segment is generally available in 10 pin package. While eight pins correspond to the eight LEDs, the remaining two pins(at middle) are common and internally shorted.
These segments come in two configurations, namely Common Cathode (CC) and Common Anode (CA).
In CC configuration, the negative terminals of all LEDs are connected to the common pins. The common is connected to the ground and a particular LED glows when its corresponding pin is given high.
In CA arrangement, the common pin given a high logic and the LED pins are given low to display a number.
PROGRAM
#include<reg51.h>
unsigned int segment_value[10]={0x40,0xF9,0x24,0x30,0x19, 0x12,0x02,0xF8,0x00,0x10}; // Hex value corresponding to the digits 0 to 9
sbit output_on_pin = P3^0; // Enable pin to enable the seven segment.
sbit stop_pin = P3^1; // Stop pin to reset the buzzer.
sbit buzzer_pin=P0^7; // Buzzer pin to sound the buzzer.

void delay() // Time delay function
{
int i,j;
for(i=0;i<200;i++)
for(j=0;j<1275;j++);
}
void display(unsigned int selected_digit) // Function to display the resultant
{ digit on the seven segment and
P2=segment_value[selected_digit]; sound the buzzer.
output_on_pin = 1;
buzzer_pin=0;
delay();
buzzer_pin=1;
while(stop_pin != 0);
}

void buzzer() //Function to monitor the input switches
{
while(1)
{
while (P1 == 0xFF);

while (P1 == 0xFE) //Check if switch 1 is pressed
{
display(1);
}

while (P1 == 0xFD) //Check if switch 2 is pressed
{
display(2);
}

while (P1 == 0xFB ) //Check if switch 3 is pressed
{
display(3);
}

while (P1 == 0xF7 ) //Check if switch 4 is pressed
{
display(4);
}

while (P1 == 0xEF ) //Check if switch 5 is pressed
{
display(5);
}

while (P1 == 0xDF) //Check if switch 6 is pressed
{
display(6);
}

while (P1 == 0xBF ) //Check if switch 7 is pressed
{
display(7);
}
while (P1 == 0x7F ) //Check if switch 8 is pressed
{
display(8);
}

P1 = 0xFF;
stop_pin = 1;
output_on_pin = 0;
}
}
void main()
{
output_on_pin=0;
stop_pin = 1;
P1 = 0xFF;
buzzer();

}
APPLICATION
Widely used in Schools, Colleges, TV programs for quiz competitions.
CONCLUSION
Hence by this project we can design an effective detecting system that can monitor in quiz competitions in schools, colleges, TV programs etc; with eight different switches. The uniqueness of this project is only alerting the quiz conductor who answered first.
THANK YOU!
Full transcript