Sunteți pe pagina 1din 8

EC2304-Microprocessor & Microcontroller

UNIT-V- Case Studies


Part-A
1. List the applications of 8051 Microcontroller.
i)
Traffic ligth control
ii)
Stepper motor control
iii)
Relay control
iv)
Washing machine control
v)
Factory automations
2. How can you control the speed of DC motor wih the help of PWM?
By changing the width of the pulse wave applied to the dc mtor.
3. List the regisers of 7-segmen display?
i)
Instruction Command Register
ii)
Dataword register
4. What is the function of SR pin in dispay device?
SR pin is used t select the registers of display devices.if it is 1 then Instruction Command Register is
selected and if it is 0 then data word Register is selected.
5. Give the A register bit patern of RTC.
SET
3-bits for scillator selectin
4-bits to provide 14 different frequncies of square
wave
6. How do you control the speed of stepper motor using 8051?
The speed of the stepper motor is controlled by changing the value of cunter register in the delay
program.
Part-B
1.How do you obtain 8051 based RTC?

EC2304-Microprocessor & Microcontroller


UNIT-V- Case Studies
Main Program

Subroutine to set time

EC2304-Microprocessor & Microcontroller


UNIT-V- Case Studies
2. Explain the Traffic Light Control module with 8051 Microcontroller.

Program
INCLUDE REG_52.PDF
NR EQU P3.5
NY EQU P3.4
NG EQU P3.3
SR EQU P1.2
SY EQU P1.3
SG EQU P1.4
ER EQU P1.5
EY EQU P1.6
EG EQU P1.7
WR EQU P3.7
WY EQU P1.0
WG EQU P1.1
CSEG AT 0 ; RESET VECTOR
;---------==========----------==========---------=========--------; PROCESSOR INTERRUPT AND RESET VECTORS
;---------==========----------==========---------=========--------ORG 00H ; Reset
JMP MAIN
;---------==========----------==========---------=========--------MAIN:
MOV SP,#40H
MOV P1,#0FFH
MOV P3,#0FFH
TOP: CLR NR
CLR SR
CLR ER
CLR WY
SETB WG

EC2304-Microprocessor & Microcontroller


UNIT-V- Case Studies
CALL Y_DELAY
SETB NR
CLR NY
CLR WR
SETB WY
CALL Y_DELAY
SETB NY
CLR NG
CALL DELAY
CLR NY
SETB NG
CALL Y_DELAY
CLR NR
SETB NY
SETB SR
CLR SY
CALL Y_DELAY
SETB SY
CLR SG
CALL DELAY
CLR SY
SETB SG
CALL Y_DELAY
CLR SR
SETB SY
SETB ER
CLR EY
CALL Y_DELAY
SETB EY
CLR EG
CALL DELAY
CLR EY
SETB EG
CALL Y_DELAY
CLR ER
SETB EY
SETB WR
CLR WY
CALL Y_DELAY
SETB WY
CLR WG
CALL DELAY
AJMP TOP
;**********************************************************
DELAY:
MOV R3,#3FH
REPA3: MOV R1,#0FFH
REPA2: MOV R2,#0FFH
REPA1: NOP
DJNZ R2,REPA1

EC2304-Microprocessor & Microcontroller


UNIT-V- Case Studies
DJNZ R1,REPA2
DJNZ R3,REPA3
RET
; ---------==========----------==========---------=========--------Y_DELAY:
MOV R3,#1AH
RQPA3:MOV R1,#0FFH
RQPA2:MOV R2,#0FFH
RQPA1:NOP
DJNZ R2,RQPA1
DJNZ R1,RQPA2
DJNZ R3,RQPA3
RET
;**********************************************************
END
3. How do you control the speed of DC motor 8051?

L293D_A equ P2.0 ;L293D A - Positive of Motor


L293D_B equ P2.1 ;L293D B - Negative of Motor

EC2304-Microprocessor & Microcontroller


UNIT-V- Case Studies
L293D_E equ P2.2 ;L293D E - Enable pin of IC
org 0H
Main:
ACALL rotate_f ;Rotate motor forward
ACALL delay ;Let the motor rotate
ACALL break ;Stop the motor
ACALL delay ;Wait for some time
ACALL rotate_b ;Rotate motor backward
ACALL delay ;Let the motor rotate
ACALL break ;Stop the motor
ACALL delay ;Wait for some time
SJMP Main ;Do this in loop
rotate_f:
SETB L293D_A ;Make Positive of motor 1
CLR L293D_B ;Make negative of motor 0
SETB L293D_E ;Enable to run the motor
RET ;Return from routine
rotate_b:
CLR L293D_A ;Make positive of motor 0
SETB L293D_B ;Make negative of motor 1
SETB L293D_E ;Enable to run the motor
RET ;Return from routine
break:
CLR L293D_A ;Make Positive of motor 0
CLR L293D_B ;Make negative of motor 0
CLR L293D_E ;Disable the o/p
RET ;Return from routine
delay: ;Some Delay
MOV R7,#20H
back: MOV R6,#FFH
back1: MOV R5,#FFH
here: DJNZ R5, here
DJNZ R6, back1
DJNZ R7, back
RET
4.Explain the schematic of Washing Machine Control using 8051.

EC2304-Microprocessor & Microcontroller


UNIT-V- Case Studies

AT89S51 microcontroller is used to control the process of washing cycle and to drive the external
output devices such as water inlet valve, wash motor, water drain valve.
The control strategy program for AT89S51 microcontroller is implemented by using assembly
language.
The process is based entirely on the principle of taking non-precise inputs from the sensors,
subjecting them to fuzzy arithmetic and obtaining a crisp value of the washing time.
The two inputs are:
1. Degree of dirt
2. Type of dirt
The degree of dirt is determined by the transparency of the wash water. The dirtier the clothes, less
transparent the water being analyzed by the sensors is.
Type of dirt is determined by the time of saturation, the time it takes to reach saturation. Saturation is
a point, at which there is no more appreciable change in the color of the water.
Degree of dirt determines how muchdirty a cloth is.
Where as Type of dirt determines the quality of dirt.
The sets of rules used here to derive the output are:
1. If dirtness_of_clothes is Large and type_of_dirt is Greasy then wash_time is VeryLong;
2. If dirtness_of_clothes is Medium and type_of_dirt is Greasy then wash_time is Long;
3. If dirtness_of_clothes is Small and type_of_dirt is Greasy then wash_time is Long;
4. If dirtness_of_clothes is Large and type_of_dirt is Medium then wash_time is Long;
5. If dirtness_of_clothes is Medium and type_of_dirt is Medium then wash_time is Medium;
6. If dirtness_of_clothes is Small and type_of_dirt is Medium then wash_time is Medium;
7. If dirtness_of_clothes is Large and type_of_dirt is NotGreasy then wash_time is Medium;
8. If dirtness_of_clothes is Medium and type_of_dirt is NotGreasy then wash_time is Short;
9. If dirtness_of_clothes is Small and type_of_dirt is NotGreasy then wash_time is VeryShort

5. Explain the interfacing of Stepper motor with 8051.

EC2304-Microprocessor & Microcontroller


UNIT-V- Case Studies

ORG 0H
STEPPER EQU P1
MAIN:
MOV STEPPER, #0CH
ACALL DELAY
MOV STEPPER, #06H
ACALL DELAY
MOV STEPPER, #03H
ACALL DELAY
MOV STEPPER, #09H
ACALL DELAY
SJMP MAIN
DELAY:
MOV R7,#4
WAIT2:
MOV R6,#0FFH
WAIT1:
MOV R5,#0FFH
WAIT:
DJNZ R5,WAIT
DJNZ R6,WAIT1
DJNZ R7,WAIT2
RET
END

S-ar putea să vă placă și