Вы находитесь на странице: 1из 23

A Minor Project Report DIGITAL GENIUS Submitted to the School of Electronics and Communication Engineering In partial fulfillment of the

requirements for the award of Degree in Electronics and Communication Engineering

Submitted By Ajay Kumar(2008EEC13) Bibhor Kumar Singh(2008EEC15) Md. Liyakat(2008EEC18)

Under the Guidance of Asst. Prof. Sumeet Gupta

School of Electronics and Communication Engineering Shri Mata Vaishno Devi University, Katra Jammu & Kashmir- 182 320 (2008-2012)

Candidates Declaration _________________________________________

This is to declare that the Project work titled Design and implementation of DIGITAL GENIUS by Ajay kumar (2008EEC13) , Bibhor Kumar Singh (2008EEC15) and Md.Liyakat(2008EEC18) of Electronics and communication engineering, SMVDU, is a bonafied work carried out by us from August 2010 to December 2010.

~1~

ACKNO WLEDGEMENTS
The satisfaction that accompanies the successful completion of any tasks would be incomplete without the mention of the people who made it possible and whose encouragement and guidance has been a source of inspiration throughout the course of the project. We take this opportunity to express our gratitude to all those who helped us to carry out this project successfully. We owe our sincere gratitude to Associate professor Sumeet Gupta for giving their encouragement , guidance and constant support at each point of time during the whole course of project ,that helped us to complete it successfully. We are deeply indebted to contribution offered by Mr. Bhawani Singh , Mr. Naresh Kumar and Mr. Atul till the end of project . We are also grateful to Mr.Vikas Singh, system engineer, Savitar Research Group ,Hydrabad, Mr. Suryansh Nigam, Research Associate at IIT, Hydrabad and Mr. Om Prakash final year student of B.TECH(ECE), SMVDU, Jammu for their valuable guidance and encouragement during the course of project. We are also thankful to Prof. Vipan Kakkar, Head of Department, ECE, Shri Mata Vaishno Devi University, for his valuable guidance during the project work. We aslo express our sincere thanks to our Parents and friends who supported and encouraged us directly or indirectly in many ways for successful completion of the project. Lastly a special thanks to Anurag Koul and Sorab Gupta for taking care of marketing issues of the project. ~2~

Certificate This is to certify that the Minor-Project entitled DIGITAL GENIUS being submitted by Ajay Kumar(2008EEC13), Bibhor Kumar Singh(2008EEC15) and Md.Liyakat(2008EEC18) to the School of Electronics and Communication Engineering, for the award of Bachelor of Technology Degree in Electronics and Communication, is a bona-fide work carried out by him under the supervision and guidance of the undersigned. His project work has reached the standard of fulfilling of requirements of the regulations related to degree.

Project Supervisor Asst. Prof. Sumeet Gupta

( Dr. Vipan Kakkar ) Director ( SECE )

~3~

Table of Contents
Declaration....2 Acknowledgement3 Certificate.4 Table content.....5 Objective6 Features..6 Block diagram...7 Description. ..8 Working.9 Code.10 Future Extensions.22 Software Listing ..23 Problem Solving & Debugging23 Results & Discussions ...24 References and Data-sheets ...24

~4~

Objective:
The project involves: Putting together the electronic circuit for implementation of Digital Clock and Appliance Controller using 8-bit (AT89C52) microcontroller.

Feature:  Clock display alongwith :     Alarm facility. Time reset ability Appliance controller. Battery backup for microcontroller operation.

~5~

Block diagram

~6~

Description:
This Digital Genius has been developed as a combination of 8051 microcontroller and various ICs, seven segment display, mechanical switches, transistor, 7-seg. Driver, resistances that are interdependent and play their unique roles in fulfillment of projects aim and vision. The supply requirement is met by stepping down main supply and rectifying it to obtain DC voltages to drive various ICs. This project involves a complete satisfactory performance of a digital clock alongwith its certain features enabling a user with basic requirements. This circuit includes: 8-bit microcontroller (AT89C52) y y y y y y ADC 0804. BCD to 7-segment decoder(7447). 7-segment display(common anode). IC 7805. Transistors(BC547) Resistors(100E,10k) of 1/2w.  10k and 100E resistors are used for biasing purpose of transistors BC547 Capacitors(33pF ,33pF ,150pF)  33pF for connecting the crystal oscillator.  150pF to supply clock pulses to ADC 0804. Crystal oscillator(11.0592MHz) Switches. Step down transformer(18-0-18)v. Relay  For appliance control with the help of transistor BC547 LM35 temperature sensor for input to ADC 0804.

y y y y y

~7~

WORKING:
A step down transformer to step down 220V to 18v The input supply (18V) is rectified by diode circuit. The ripples are eliminated by filter and regulator ICs. A 5V Vcc is supplied to the microcontroller at pin no. 40 for its proper functioning, along with a capacitor(150pF) to remove the ripples. Pin no. 31 is set to 1 by connecting it to Vcc.(No external fetch). Port 0 is used for supplying inputs to BCD to 7-segment decoder. Half of the port_0 (P0.0-P0.3) is connected to one of the two IC SN74LS47 to send data to one set of 7-segment displays for displaying unit place of each Hour, Minute and Second respectively. Another half of port_0 (P0.4-P0.7)is connected to other IC SN74LS47 to send data to another set of 7-segment displays for displaying tens place of each Hour, Minute and Second respectively. The common anode of each 7-SEGMENT display is connected to emitter of their respective transistors to enable the 7-segment displays. Base of each transistor those are used to enable the 7-segment display is driven by connecting the bases of transistors to the port line no.(P2.7,P2.6,P2.5). Pin no. 9 of AT89C52 is used for RESET purpose with the help of a mechanical switch. Each 7-segment display is enabled by sending 1 to respective transistor. Port line no. P2.1 and P2.2 are used to set Hour and Minute respectively. Port line no. P2.4(S1) and P3.4(S0) are used to set mode of operation of the system.  S1=1,S0=1(clock mode) ~8~

 S1=0,S0=1(Timer mode)  S1=1,S0=0(Appliance control mode)  S1=0,S0=0(Temp. indicator mode) y Alarm is connected to port line no.P3.5. y Port 2 is connected to ADC lines for transfer of data(D7-D0) and connecting the RD(active low),WR(active low), INTR(active low) signals. y A 5V Vcc is also used for biasing of all transistors BC547, 100E as Rc and 10k as Rb.

CODE

y y y y y y y y y y y y y y y y

HHC EQU 40H MMC EQU 41H SSC EQU 42H TMPU EQU 43H TMPL EQU 44H TMPS EQU 45H APCLM EQU 46H APCLH EQU 47H APCUM EQU 48H APCUH EQU 49H HHA EQU 4AH MMA EQU 4BH ORG 0000H LJMP MAIN ORG 001BH LJMP CLK_INT

y ORG 0300H y MAIN: MOV SP,#80H ~9~

y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y

MOV IE,#88H SETB IP.3 MOV TMOD,#11H MOV P0,#00H MOV P1,#0FFH CLR P2.0 SETB P2.1 SETB P2.2 SETB P2.3 SETB P2.4 CLR P2.5 CLR P2.6 CLR P2.7 SETB P3.1 SETB P3.2 SETB P3.3 SETB P3.4 CLR P3.5 CLR P3.6 CLR P3.7 MOV HHC,#00H MOV MMC,#00H MOV SSC,#00H MOV TMPU,#00H MOV TMPL,#00H MOV TMPS,#00H MOV APCLM,#00H MOV APCLH,#00H MOV APCUM,#00H MOV APCUH,#00H MOV HHA,#00H MOV MMA,#00H ~ 10 ~

y MOV TL1,#0FCH y MOV TH1,#1EH y JB P3.4,MCHEK_1 y JNB P3.4,MCHEK_2 y MCHEK_1: JB P2.4,CLOCK y JNB P2.4,TIMER y MCHEK_2: JB P2.4,APCON y JNB P2.4,TEMPI

y CLOCK: SETB TR1 y MOV B,#3CH y MOV R1,#00H y LOOP_1: JNB P3.4,MCHEK_2 y JNB P2.4,TIMER y JB P3.2,GOTO_1 y LCALL ALLARM_STNG y GOTO_1:JB P3.3,GOTO_2 y LCALL CLOCK_STNG y GOTO_2:MOV A,SSC y LCALL CNVBCD y MOV P0,A y CLR P2.6 y CLR P2.7 y SETB P2.5 y LCALL DELAY_10 y MOV A,MMC y LCALL CNVBCD y MOV P0,A y CLR P2.5 y CLR P2.7 ~ 11 ~

y y y y y y y y y y

SETB P2.6 LCALL DELAY_10 MOV A,HHC LCALL CNVBCD MOV P0,A CLR P2.6 CLR P2.5 SETB P2.7 LCALL DELAY_10 JMP LOOP_1

y MCHEK_01:

LJMP MCHEK_1

y CNVBCD: MOV B,#0AH y DIV AB y ANL A,#0FH y ANL B,#0FH y RR A y RR A y RR A y RR A y ORL A,B y MOV B,#3CH y RET y y y y TIMER: APCON: MCHEK_02: MCHEK_1_1: LJMP TIMER1 LJMP APCON1 LJMP MCHEK_2 LJMP MCHEK_1

y TEMPI: y

CLR P2.7 CLR P2.6 ~ 12 ~

y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y LOOP_5:

SETB P2.5 CLR P3.6 JB P3.4,MCHEK_1_1 JB P2.4,APCON JB P3.3,GOTO_3 LCALL TEMPI_STNG CLR P3.6 NOP SETB P3.6 JB P3.1,LOOP_6 SETB P3.7 NOP CLR P3.7 LCALL DELAY_10 MOV TMPS,A LCALL CNVBCD MOV P0,A MOV A,TMPL CLR C SUBB A,TMPS JC NEXT_8 CLR P2.0 SJMP NEXT_10 CLR C SUBB A,TMPU JC NEXT_9 CLR P2.0 SJMP NEXT_10 SETB P2.0 LJMP LOOP_5 LJMP CLOCK CLR P2.7 ~ 13 ~

GOTO_3:

LOOP_6:

NEXT_8:

NEXT_9: NEXT_10: CLOCK_1: APCON1:

y y y y y y y y y y y y y y y y y y y y y y y y

LOOP_7:

GOTO_4:

NEXT_12: NEXT_11:

NEXT_14: NEXT_13:

CLR P2.6 SETB P2.5 MOV P0,#00H JB P3.4,MCHEK_01 JNB P2.4,TEMPI JB P3.3,GOTO_4 LCALL APCON_STNG MOV A,HHC CJNE A,APCLH,NEXT_11 MOV A,MMC CJNE A,APCLM,NEXT_12 SETB P2.0 MOV P0,#01H SETB P2.5 NOP MOV A,HHC CJNE A,APCUH,NEXT_13 MOV A,MMC CJNE A,APCUM,NEXT_14 CLR P2.0 MOV P0,#00H SETB P2.5 NOP SJMP LOOP_7

y MCHEK_02_1: LJMP MCHEK_02 y y TIMER1: NOP y REPEAT: JNB P3.4,MCHEK_02_1 y JB P2.4,CLOCK_1 y SJMP REPEAT

~ 14 ~

y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y

CLOCK_STNG: CLR TR1 SETB P2.5 SETB P2.6 SETB P2.7 MOV P0,#00H LOOP_8: JB P2.2,NEXT_20 BACK_A: JNB P2.2,BACK_A MOV R2,MMC CJNE R2,#3CH,NEXT_21 MOV MMC,#00H NEXT_21: INC MMC MOV A,MMC LCALL CNVBCD CLR P2.7 CLR P2.5 SETB P2.6 MOV P0,A NEXT_20: JB P2.1,NEXT_22 BACK_B: JNB P2.1,BACK_B MOV R2,HHC CJNE R2,#19H,NEXT_23 MOV HHC,#00H NEXT_23: INC HHC MOV A,HHC LCALL CNVBCD CLR P2.6 CLR P2.5 SETB P2.7 MOV P0,A NEXT_22: JB P2.3,LOOP_8 BACK_C: JNB P2.3,BACK_C SETB TR1 ~ 15 ~

RET

y y y y y y y y y y y y y y y y y y y y y y y y y y y y y

TEMPI_STNG: SETB P2.6 CLR P2.7 SETB P2.5 MOV P0,#00H LOOP_9: JB P2.2,NEXT_24 BACK_D: JNB P2.1,BACK_D MOV R2,TMPL CJNE R2,#63H,NEXT_25 MOV TMPL,#00H NEXT_25: INC TMPL MOV A,TMPL LCALL CNVBCD MOV P0,A CLR P2.5 SETB P2.6 NEXT_24: JB P2.1,NEXT_26 BACK_E: JNB P2.1,BACK_E MOV R2,TMPU CJNE R2,#63H,NEXT_27 MOV TMPU,#00H NEXT_27: INC TMPU MOV A,TMPU LCALL CNVBCD MOV P0,A CLR P2.6 SETB P2.5 NEXT_2: JB P2.3,LOOP_9 BACK_F: JNB P2.3,BACK_F RET

~ 16 ~

y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y

APCON_STNG: CLR P2.7 CLR P2.6 SETB P2.5 MOV P0,#01H LOOP_10: JB P2.2,NEXT_28 BACK_1: JNB P2.2,BACK_1 MOV R2,APCLM CJNE R2,#3CH,NEXT_29 MOV APCLM,#00H NEXT_29: INC APCLM MOV A,APCLM LCALL CNVBCD CLR P2.5 CLR P2.7 SETB P2.6 MOV P0,A NEXT_28: JB P2.1,NEXT_30 BACK_2: JNB P2.1,BACK_2 MOV R2,APCLH CJNE R2,#18H,NEXT_31 MOV APCLH,#00H NEXT_31: INC APCLH MOV A,APCLH LCALL CNVBCD CLR P2.6 SETB P2.7 MOV P0,A NEXT_30: JB P2.3,LOOP_10 BACK_3: JNB P2.3,BACK_3 CLR P2.6 CLR P2.7 SETB P2.5 MOV P0,#00H ~ 17 ~

y y y y y y y y y y y y y y y y y y y y y y y y y

LOOP_11: JB P2.2,NEXT_32 BACK_4: JNB P2.2,BACK_4 MOV R2,APCUM CJNE R2,#3CH,NEXT_33 MOV APCUM,#00H NEXT_33: INC APCUM MOV A,APCUM LCALL CNVBCD CLR P2.5 SETB P2.6 MOV P0,A NEXT_32: JB P2.1,NEXT_34 BACK_5: JNB P2.1,BACK_5 MOV R2,APCUH CJNE R2,#18H,NEXT_35 MOV APCUH,#00H NEXT_35: INC APCUH MOV A,APCUH LCALL CNVBCD CLR P2.6 SETB P2.7 MOV P0,A NEXT_34: JB P2.3,LOOP_11 BACK_6: JNB P2.3,BACK_6 RET

y DELAY_10: NOP y REP: MOV TL0,#0F0H y MOV TH0,#0D8H y SETB TR0 y AGAIN: JNB TF0,AGAIN y CLR TF0 ~ 18 ~

RET

y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y

ALLARM_STNG: MOV A,#00H MOV P0,A SETB P2.5 SETB P2.6 SETB P2.7 LOOP_2: JB P2.2,NEXT_6 LOOP_3: JNB P2.2,LOOP_3 MOV R2,MMA CJNE R2,#3CH,NEXT_P MOV MMA,#00H NEXT_P: INC MMA MOV A,MMA CLR P2.7 CLR P2.5 SETB P2.6 LCALL CNVBCD MOV P0,A NEXT_6: JB P2.1,NEXT_7 LOOP_4: JNB P2.1,LOOP_4 MOV R2,HHA CJNE R2,#18H,NEXT_Q MOV HHA,#00H NEXT_Q: INC HHA MOV A,HHA CLR P2.6 CLR P2.5 SETB P2.7 LCALL CNVBCD MOV P0,A NEXT_7: JB P2.3,LOOP_2 ~ 19 ~

y BACK_R: y

JNB P2.3,BACK_R RETI

y CLK_INT: CLR TR1 y MOV TL1,#0FCH y TIMER_STNG:RET y y END

Future Extensions
 Serial Communication facility(using TxD,RxD pins). o The facility acquired by serial communication can be utilized in the sense that one can easily load the code onto the microcontroller chip without dismounting the chip from the system board, and hence the overall process of debugging and testing becomes easier.  Event counter. o Using the Timer in counter mode operation one count the number of times a particular event occurs during an interval, which can be a method of finding the frequency of an arbitrary periodic wave acknowledge at one of the interrupt pin of AT89C52 microcontroller.  Timer Recorder. o We noticed that one more enhancement can be done while dealing with timer block, that is Time Recorder with help of which one can measure the interval during which an event was in effect.

Software Listing
1. Keil uvision3

~ 20 ~

Using Keil software testing of the code written for the project for errors became easier so that different approaches for the target code were undertaken. 2. Multisim Using Multisim the various circuit diagrams were drawn for the well understanding of the project and good display of the design through block diagrams. 3.Chip Prog Python+ For burning program in microcontroller.

Problems and Debugging


At the first instant when the project was designed on the bread-board the circuit did not responded at all due to loose connections and various overlapping of the wires, and faulty LEDs, but as soon as it was mounted on a zero-hole board then it worked quite well, but some problems remained in effect because of some code instructions, it required a little adjustment, debugging and correction in the code, going through this stage a correct output was observed and it worked successfully. At different stages we faced problems due to unavailability of the components in the market but it was removed with the issuing of components from the laboratory with prior permission of Dr. Vipan Kakkar(Director of SECE)

~ 21 ~

Results and Discussion:


The Digital Clock is functioning well, its timer mode as well as Appliance controller mode are working very well. All the parameters have been observed correctly. Its future extensions have been noticed and will be taken as future reference features so that its overall working and efficiency can be enhanced accordingly.

References
1. www.datasheets.com 2. www.alldatasheets.com 3. www.datasheetcatalog.com 4. www.sparkfun.com 5. www.axman.com 6. www.dunfield.com 7. www.fsinc.com 8. The 8051 microcontroller and Embedded systems (PEARSON Education) 9. www.MicroDigitalED.com 10. www.wikipidia.com

~ 22 ~

Вам также может понравиться