SlideShare a Scribd company logo
Raisoni College of Engineering
An Autonomous Institution under UGC Act 1965 |Accredited by NBA & NAAC ‘A’ Grade
DEPARTMENT OF ELECTRONICS AND TELECOMMUNICATION
ENGINEERING
Session:
2015-2016 (EVEN Semester)
Semester/Branch/Section: –VII / ETC – C
Name of Subject:
Embedded System
TAE 3
Report on:
Program, Code of Program
and
Screen Shot of Output
(UNIVERSAL DRIVER USING µc P89c51)
Submitted by:
Akash Shahu (Roll No. 26)
Ashish Pandey (Roll No. 30)
Sumitted To:
Prof. S. Nimkar
E&TC Department, G.H.R.C.E.
Report on:
Program, Code of Program and Screen Shot of Output
UNIVERSAL DRIVER USING µc P89c51
INTRODUCTION:
* Motors are considered as one of the most importantpart of an Industry.
All the functions of the industries works on different types of motors.
There are various types of motors being used in industry depending
upon its application. The Ac and Dc motor required different type of
controller to control the speed of motor .
* But actually our aim to design universaldrive controller.
* The Whole hardwarestructurecan be processed in a single central unit
and can be termed as a universalcontroller. Temperature sensors,
Currentsensors, Speed sensors etc can be included into the hardwareas
per the application requirement .
Block Diagram:
Methodology:
There are two methods used while designing the controller
DC Controller:
For DC motor control is done by using a simple voltage divider method.
AC Controller:
 Why use PWMfor speed variation?
 When an AC motor is connected directly to an AC line (415V 3Φfor
example) the motor speed is fixed and is calculated as follows
 𝑛𝑠=120∗𝑓/𝑝 − 𝑠𝑙𝑖𝑝
 ns = Motor speed (RPM)
 f = fundamental frequency(Hz)
 p = no. of poles
Controller
DC Motor
Control
AC Motor
Control
8051 micro-controller(P89V51RD2):
Features:-
 8051 Central Processing Unit
 5 V Operating voltage from 0 to 40 MHz
 64kBof on-chip Flash program memory
 Supports12-clock/6-clockmode
 SPI(SerialPeripheralInterface)
 Three 16-bit timers/counters
 TTL- and CMOS-compatiblelogic levels
 RXD/TXD Pins available
L293D (Motor Driver IC):
 Wide Supply-VoltageRange: 4.5 V to 36 V.
 Separate Input-Logic Supply.
 Thermal Shutdown.
 High-Noise-Immunity Inputs.
 Peak OutputCurrent 2 A Per Channel (1.2 A for L293D)
Software Required:
 FLASH MAGIC - This softwarehelps to dump the program opcodes to the
microcontroller. This allows easy access to all the ISP features by the
device. i.e. programming the flash memory, Reading from flash memory.
 Embedded PCB Designer - This will help for designing the circuit on the
printed circuit board.
 MATLAB version2012–This softwarewould providea graphicaluser
interface (GUI) between machine and man it will be used for creating a
graphical user interface for the application with the help of components
available on the window. The application softwareto interface hardware
systemconnected to PC using COM ports and provideGUI interface.
Advantages
 A controller design for Torquecontrol of AC & DC motor
 Starter-less operation.
 The Whole hardwarestructurecan be Reconfigurable as universal
controller.
 This controller also gives an intelligent motor control (IMC) operation.
 Speed control of any motor is important because required speed to
accomplish a specific task
Application
 This systemmay be used to run High graded IndustrialMotors according
to speed requirement.
 Both AC as well as DC Drive will be in on system.
 The systemwill be softwarecontrolled. So the user can enable or disable
the systemfromhis/her office room.
Screen Shot:
OPERATING SCHEME
 When both motor are off:-
When DC is operating
When AC motor is operating
Coding/Programming in MATLAB Tool:
--------------------------------------------------------------
; TRIAC -> P1.0 || ZERO CREOSING ->P3.7
; FIRE OFF TIMING : 4ms, 8ms,12ms, 16ms
;------------------------------------------------------------
$MOD51
TRIAC EQU P1.0
HIGH_TIMEEQU R0
LOW_TIMEEQU R1
RELAY_12V EQU P0.0
RELAY_9V EQU P0.1
RELAY_5V EQU P0.2
MOV P0,#0FFH ; INTIALLYALL RELAYOFF
CLR TRIAC ; INITALLYMAKEMOTOR OFF
MOV P2,#0FFH ; MAKE PULLUP HIGH
MOV P3,#0FFH ; MAKE SENS DATA HIGH
MOV TMOD,#21H ; TIMER 0 SELECTED, enabletimer1, mode2 (autoreload)
MOV TH0,#0FFH ; LOAD VALUE
MOV TL0,#0FEH
MOV TH1,#0FDH ;9600 Baud rate
MOV SCON,#50H ;8 bit, 1 stopbit, REN enabled
SETB TR1
MOV R7,#00H ;USED TO ENABLE LOOP
MOV SBUF,A
JNB TI,$
CLR TI
START:
JNB RI,$
CLR RI
MOV A,SBUF
SJMP KEY_1
CHECK_KEYS:
JNB RI,CHECK_SENSOR
CLR RI
MOV A,SBUF
SJMP KEY_1
CHECK_SENSOR:
CJNER7,#01H,CHECK_KEYS
MOV TH0,HIGH_TIME ; LOAD DEFAUL VALUE
MOV TL0,LOW_TIME
CLR TF0 ; CLEAR TF0 FLAG
CLR TRIAC ; OFF TRAIC
SETB TR0 ; START TIMER 0
JNB TF0,$ ; WAITTILL FLAG SETI.E.(ALPHAANGLEFOR
FIRING)
SETB TRIAC ; BETA ANGLE
SJMP CHECK_KEYS
;-----------------------------------------------------------
; 13ms =>65536uS -13000uS =>52536uS =>DD38 =>25%SPEED
;-----------------------------------------------------------
KEY_1:
CJNEA,#'5',KEY_2
MOV HIGH_TIME,#0CDH
MOV LOW_TIME,#38H
MOV R7,#01H
LJMP CHECK_KEYS
;-----------------------------------------------------------
; 10ms =>65536uS -10000uS =>55536uS =>D8F0 =>50% SPEED
;-----------------------------------------------------------
KEY_2:
CJNEA,#'6',KEY_3
MOV HIGH_TIME,#0D8H
MOV LOW_TIME,#0F0H
MOV R7,#01H
LJMP CHECK_KEYS
;-----------------------------------------------------------
; 8ms =>65536uS - 4000uS =>61536uS =>F060 =>75% SPEED
;-----------------------------------------------------------
KEY_3:
CJNEA,#'7',KEY_4
MOV HIGH_TIME,#0F0H
MOV LOW_TIME,#60H
MOV R7,#01H
LJMP CHECK_KEYS
;-----------------------------------------------------------
; 0.05ms =>65536uS -50uS =>65486uS =>FFCE=>100% SPEED
;-----------------------------------------------------------
KEY_4:
CJNEA,#'8',AC_OFF
MOV HIGH_TIME,#0FFH
MOV LOW_TIME,#0CEH
MOV R7,#01H
LJMP CHECK_KEYS
AC_OFF:
CJNEA,#'9',DC_5V
CLR TRIAC
MOV R7,#00H
LJMP CHECK_KEYS
;############################################################
; DC MOTOR
;############################################################
DC_5V:
CJNEA,#'2',DC_9V
SETB RELAY_12V ;OFF RELAY
SETB RELAY_9V ;OFF RELAY
CLR RELAY_5V
DC_9V:
CJNEA,#'1',DC_12V
SETB RELAY_12V ;OFF RELAY
SETB RELAY_5V ;OFF RELAY
CLR RELAY_9V
DC_12V:
CJNEA,#'3',DC_OFF
SETB RELAY_9V ;OFF RELAY
SETB RELAY_5V ;OFF RELAY
CLR RELAY_12V
DC_OFF:
CJNEA,#'4',ALL_OFF
SETB RELAY_12V ;OFF RELAY
SETB RELAY_9V ;OFF RELAY
SETB RELAY_5V
ALL_OFF:
CJNEA,#'0',RETURN_KEY
CLR TRIAC
MOV R7,#00H
SETB RELAY_12V ;OFF ALL RELAY
SETB RELAY_9V
SETB RELAY_5V,
RETURN_KEY:
LJMP CHECK_KEYS
;*******************************************************************
; SERIAL SETTINGS FUNCTION
;*******************************************************************
SERIAL:
MOV TMOD,#20H ;enable timer1, mode2 (auto reload)
MOV TH1,#0FDH ;9600 Baud rate
MOV SCON,#50H ;8 bit, 1 stopbit, REN enabled
SETB TR1
RET
;*******************************************************************
; FUNCTION FOR SENDING CHARACTER
;*******************************************************************
SEND_CHAR:
MOV SBUF,A
JNB TI,$
CLR TI
RET
;*******************************************************************
; FUNCTION FOR RECEIVING CHARACTER
;*******************************************************************
RECV_CHAR:
JNB RI,$
CLR RI
MOV A,SBUF
RET
;------------------------------------------------------------
; TRIAC -> P1.0 || ZERO CREOSING ->P3.7
; FIRE OFF TIMING : 4ms, 8ms,12ms, 16ms
;------------------------------------------------------------
$MOD51
TRIAC EQU P1.0
HIGH_TIMEEQU R0
LOW_TIMEEQU R1
RELAY_12V EQU P0.0
RELAY_9V EQU P0.1
RELAY_5V EQU P0.2
MOV P0,#0FFH ; INTIALLYALL RELAYOFF
CLR TRIAC ; INITALLYMAKEMOTOR OFF
MOV P2,#0FFH ; MAKE PULLUP HIGH
MOV P3,#0FFH ; MAKE SENS DATA HIGH
MOV TMOD,#21H ; TIMER 0 SELECTED, enabletimer1, mode2 (autoreload)
MOV TH0,#0FFH ; LOAD VALUE
MOV TL0,#0FEH
MOV TH1,#0FDH ;9600 Baud rate
MOV SCON,#50H ;8 bit, 1 stopbit, REN enabled
SETB TR1
MOV R7,#00H ;USED TO ENABLE LOOP
MOV SBUF,A
JNB TI,$
CLR TI
START:
JNB RI,$
CLR RI
MOV A,SBUF
SJMP KEY_1
CHECK_KEYS:
JNB RI,CHECK_SENSOR
CLR RI
MOV A,SBUF
SJMP KEY_1
CHECK_SENSOR:
CJNER7,#01H,CHECK_KEYS
MOV TH0,HIGH_TIME ; LOAD DEFAUL VALUE
MOV TL0,LOW_TIME
CLR TF0 ; CLEAR TF0 FLAG
CLR TRIAC ; OFF TRAIC
SETB TR0 ; START TIMER 0
JNB TF0,$ ; WAITTILL FLAG SETI.E.(ALPHAANGLEFOR
FIRING)
SETB TRIAC ; BETA ANGLE
SJMP CHECK_KEYS
;-----------------------------------------------------------
; 13ms =>65536uS -13000uS =>52536uS =>DD38 =>25%SPEED
;-----------------------------------------------------------
KEY_1:
CJNEA,#'5',KEY_2
MOV HIGH_TIME,#0CDH
MOV LOW_TIME,#38H
MOV R7,#01H
LJMP CHECK_KEYS
;-----------------------------------------------------------
; 10ms =>65536uS -10000uS =>55536uS =>D8F0 =>50% SPEED
;-----------------------------------------------------------
KEY_2:
CJNEA,#'6',KEY_3
MOV HIGH_TIME,#0D8H
MOV LOW_TIME,#0F0H
MOV R7,#01H
LJMP CHECK_KEYS
;-----------------------------------------------------------
; 8ms =>65536uS - 4000uS =>61536uS =>F060 =>75% SPEED
;-----------------------------------------------------------
KEY_3:
CJNEA,#'7',KEY_4
MOV HIGH_TIME,#0F0H
MOV LOW_TIME,#60H
MOV R7,#01H
LJMP CHECK_KEYS
;-----------------------------------------------------------
; 0.05ms =>65536uS -50uS =>65486uS =>FFCE=>100% SPEED
;-----------------------------------------------------------
KEY_4:
CJNEA,#'8',AC_OFF
MOV HIGH_TIME,#0FFH
MOV LOW_TIME,#0CEH
MOV R7,#01H
LJMP CHECK_KEYS
AC_OFF:
CJNEA,#'9',DC_5V
CLR TRIAC
MOV R7,#00H
LJMP CHECK_KEYS
;############################################################
; DC MOTOR
;############################################################
DC_5V:
CJNEA,#'2',DC_9V
SETB RELAY_12V ;OFF RELAY
SETB RELAY_9V ;OFF RELAY
CLR RELAY_5V
DC_9V:
CJNEA,#'1',DC_12V
SETB RELAY_12V ;OFF RELAY
SETB RELAY_5V ;OFF RELAY
CLR RELAY_9V
DC_12V:
CJNEA,#'3',DC_OFF
SETB RELAY_9V ;OFF RELAY
SETB RELAY_5V ;OFF RELAY
CLR RELAY_12V
DC_OFF:
CJNEA,#'4',ALL_OFF
SETB RELAY_12V ;OFF RELAY
SETB RELAY_9V ;OFF RELAY
SETB RELAY_5V
ALL_OFF:
CJNEA,#'0',RETURN_KEY
CLR TRIAC
MOV R7,#00H
SETB RELAY_12V ;OFF ALL RELAY
SETB RELAY_9V
SETB RELAY_5V,
RETURN_KEY:
LJMP CHECK_KEYS
;*******************************************************************
; SERIAL SETTINGS FUNCTION
;*******************************************************************
SERIAL:
MOV TMOD,#20H ;enable timer1, mode2 (auto reload)
MOV TH1,#0FDH ;9600 Baud rate
MOV SCON,#50H ;8 bit, 1 stopbit, REN enabled
SETB TR1
RET
;*******************************************************************
; FUNCTION FOR SENDING CHARACTER
;*******************************************************************
SEND_CHAR:
MOV SBUF,A
JNB TI,$
CLR TI
RET
;*******************************************************************
; FUNCTION FOR RECEIVING CHARACTER
;*******************************************************************
RECV_CHAR:
JNB RI,$
CLR RI
MOV A,SBUF
RET

More Related Content

What's hot

Plc analog input output programming
Plc analog input output programmingPlc analog input output programming
Plc analog input output programming
Engr Alam
 
174085193 pic-prgm-manual
174085193 pic-prgm-manual174085193 pic-prgm-manual
174085193 pic-prgm-manual
Arun Shan
 
Plc
PlcPlc
DCS PRESENTATION
DCS PRESENTATIONDCS PRESENTATION
DCS PRESENTATION
bvent2005
 
Basic plc-programming-e book_Reliance High Tech Ltd
Basic plc-programming-e book_Reliance High Tech LtdBasic plc-programming-e book_Reliance High Tech Ltd
Basic plc-programming-e book_Reliance High Tech Ltd
Marsus Marsus
 
How to setup ACS Controller and Omron CJ2M PLC EtherNet/IP Configuration Steps
How to setup ACS Controller and Omron CJ2M PLC  EtherNet/IP Configuration StepsHow to setup ACS Controller and Omron CJ2M PLC  EtherNet/IP Configuration Steps
How to setup ACS Controller and Omron CJ2M PLC EtherNet/IP Configuration Steps
Tolomatic
 
Manual CLP Omron CP1H
Manual CLP Omron CP1HManual CLP Omron CP1H
Manual CLP Omron CP1H
Jorge Eduardo Uliana
 
Plc timers
Plc timersPlc timers
Plc timers
MANOJ KHARADE
 
Siemens Automation Station Compact Model PXC52
Siemens Automation Station Compact Model PXC52Siemens Automation Station Compact Model PXC52
Siemens Automation Station Compact Model PXC52
CONTROLS & SYSTEMS
 
JVL AC Servo Motor Controllers AMC20, AMC21 and AMC22
JVL AC Servo Motor Controllers AMC20, AMC21 and AMC22JVL AC Servo Motor Controllers AMC20, AMC21 and AMC22
JVL AC Servo Motor Controllers AMC20, AMC21 and AMC22
Electromate
 
PLC BASED AUTOMATED SYSTEM IN PROCESS INDUSTRY (Final Presentation)
PLC BASED AUTOMATED SYSTEM IN PROCESS INDUSTRY (Final Presentation)PLC BASED AUTOMATED SYSTEM IN PROCESS INDUSTRY (Final Presentation)
PLC BASED AUTOMATED SYSTEM IN PROCESS INDUSTRY (Final Presentation)Shahid Faizee
 
Analog module omron
Analog module omronAnalog module omron
Analog module omron
Alain Hua
 
Omron cp1 h
Omron cp1 h Omron cp1 h
Omron cp1 h
Choochart Thongnark
 
PLC (Programmable Logic Controller) S.M.54
PLC (Programmable Logic Controller) S.M.54PLC (Programmable Logic Controller) S.M.54
PLC (Programmable Logic Controller) S.M.54
Subhash Mahla
 
Omron plc training
Omron plc trainingOmron plc training
Omron plc training
Hesham Abdelhady
 
speed control of induction motor using plc and vfd
speed control of induction motor using plc and vfdspeed control of induction motor using plc and vfd
speed control of induction motor using plc and vfd
manishrair
 

What's hot (20)

Plc analog input output programming
Plc analog input output programmingPlc analog input output programming
Plc analog input output programming
 
174085193 pic-prgm-manual
174085193 pic-prgm-manual174085193 pic-prgm-manual
174085193 pic-prgm-manual
 
Plc
PlcPlc
Plc
 
DCS PRESENTATION
DCS PRESENTATIONDCS PRESENTATION
DCS PRESENTATION
 
Basic plc-programming-e book_Reliance High Tech Ltd
Basic plc-programming-e book_Reliance High Tech LtdBasic plc-programming-e book_Reliance High Tech Ltd
Basic plc-programming-e book_Reliance High Tech Ltd
 
Basic plc
Basic plcBasic plc
Basic plc
 
A TRAFFIC LIGHT CONTROL SYSTEM USING PROGRAMMABLE LOGIC CONTROLLER
A TRAFFIC LIGHT CONTROL SYSTEM USING PROGRAMMABLE LOGIC CONTROLLERA TRAFFIC LIGHT CONTROL SYSTEM USING PROGRAMMABLE LOGIC CONTROLLER
A TRAFFIC LIGHT CONTROL SYSTEM USING PROGRAMMABLE LOGIC CONTROLLER
 
How to setup ACS Controller and Omron CJ2M PLC EtherNet/IP Configuration Steps
How to setup ACS Controller and Omron CJ2M PLC  EtherNet/IP Configuration StepsHow to setup ACS Controller and Omron CJ2M PLC  EtherNet/IP Configuration Steps
How to setup ACS Controller and Omron CJ2M PLC EtherNet/IP Configuration Steps
 
Manual CLP Omron CP1H
Manual CLP Omron CP1HManual CLP Omron CP1H
Manual CLP Omron CP1H
 
Datasheet omron clp
Datasheet omron clpDatasheet omron clp
Datasheet omron clp
 
Plc timers
Plc timersPlc timers
Plc timers
 
Siemens Automation Station Compact Model PXC52
Siemens Automation Station Compact Model PXC52Siemens Automation Station Compact Model PXC52
Siemens Automation Station Compact Model PXC52
 
JVL AC Servo Motor Controllers AMC20, AMC21 and AMC22
JVL AC Servo Motor Controllers AMC20, AMC21 and AMC22JVL AC Servo Motor Controllers AMC20, AMC21 and AMC22
JVL AC Servo Motor Controllers AMC20, AMC21 and AMC22
 
PLC BASED AUTOMATED SYSTEM IN PROCESS INDUSTRY (Final Presentation)
PLC BASED AUTOMATED SYSTEM IN PROCESS INDUSTRY (Final Presentation)PLC BASED AUTOMATED SYSTEM IN PROCESS INDUSTRY (Final Presentation)
PLC BASED AUTOMATED SYSTEM IN PROCESS INDUSTRY (Final Presentation)
 
Analog module omron
Analog module omronAnalog module omron
Analog module omron
 
Omron cp1 h
Omron cp1 h Omron cp1 h
Omron cp1 h
 
PLC (Programmable Logic Controller) S.M.54
PLC (Programmable Logic Controller) S.M.54PLC (Programmable Logic Controller) S.M.54
PLC (Programmable Logic Controller) S.M.54
 
PLC
PLCPLC
PLC
 
Omron plc training
Omron plc trainingOmron plc training
Omron plc training
 
speed control of induction motor using plc and vfd
speed control of induction motor using plc and vfdspeed control of induction motor using plc and vfd
speed control of induction motor using plc and vfd
 

Similar to Program, Code of Program and Screen Shot of Output (UNIVERSAL DRIVER USING µc P89c51)

Basic PLC
Basic PLCBasic PLC
Basic PLC
Hammzah Niazi
 
Basic plc
Basic plcBasic plc
Basic plc
gmvd201091
 
Basic plc
Basic plcBasic plc
Basic plc
mnamky
 
Basic plc
Basic plcBasic plc
Basic plc
kaishik gundu
 
Basic plc
Basic plcBasic plc
Basic plc
shubhammanit
 
Programmable Logic Controller Training Day 1 to 3.pptx
Programmable Logic Controller  Training Day 1 to 3.pptxProgrammable Logic Controller  Training Day 1 to 3.pptx
Programmable Logic Controller Training Day 1 to 3.pptx
dmckinseyrecruitment
 
Basic PLC.ppt
Basic PLC.pptBasic PLC.ppt
Basic PLC.ppt
RaghadAlnajim1
 
Basic plc
Basic plcBasic plc
embedded system
embedded systemembedded system
embedded system
Vivek Ranjan
 
n5acb0f1c011fb.pdf
n5acb0f1c011fb.pdfn5acb0f1c011fb.pdf
n5acb0f1c011fb.pdf
sharathkumar299627
 
At89 c2051 (3)
At89 c2051 (3)At89 c2051 (3)
At89 c2051 (3)
angiey y
 
Basic plc 1
Basic plc 1Basic plc 1
Basic plc 1
Gaurav Kumar
 
8051 Presentation
8051 Presentation8051 Presentation
8051 Presentation
Sayan Chakraborty
 

Similar to Program, Code of Program and Screen Shot of Output (UNIVERSAL DRIVER USING µc P89c51) (20)

Basic PLC
Basic PLCBasic PLC
Basic PLC
 
Basic plc
Basic plcBasic plc
Basic plc
 
Basic plc
Basic plcBasic plc
Basic plc
 
Basic plc
Basic plcBasic plc
Basic plc
 
Basic plc
Basic plcBasic plc
Basic plc
 
Basic plc
Basic plcBasic plc
Basic plc
 
Basic plc
Basic plcBasic plc
Basic plc
 
Programmable Logic Controller Training Day 1 to 3.pptx
Programmable Logic Controller  Training Day 1 to 3.pptxProgrammable Logic Controller  Training Day 1 to 3.pptx
Programmable Logic Controller Training Day 1 to 3.pptx
 
Basic plc
Basic plcBasic plc
Basic plc
 
Basic PLC.ppt
Basic PLC.pptBasic PLC.ppt
Basic PLC.ppt
 
Basic plc
Basic plcBasic plc
Basic plc
 
embedded system
embedded systemembedded system
embedded system
 
n5acb0f1c011fb.pdf
n5acb0f1c011fb.pdfn5acb0f1c011fb.pdf
n5acb0f1c011fb.pdf
 
89 c2051
89 c205189 c2051
89 c2051
 
At89 c2051 (3)
At89 c2051 (3)At89 c2051 (3)
At89 c2051 (3)
 
Basic plc 1
Basic plc 1Basic plc 1
Basic plc 1
 
8051 Presentation
8051 Presentation8051 Presentation
8051 Presentation
 
Basic PLC.ppt
Basic PLC.pptBasic PLC.ppt
Basic PLC.ppt
 
embedded system bye Sj
embedded system bye Sjembedded system bye Sj
embedded system bye Sj
 
S emb t7-arch_bus
S emb t7-arch_busS emb t7-arch_bus
S emb t7-arch_bus
 

More from Er. Ashish Pandey

Salman Khan's Top 10 Best Films
Salman Khan's Top 10 Best FilmsSalman Khan's Top 10 Best Films
Salman Khan's Top 10 Best Films
Er. Ashish Pandey
 
Optical character recognition IEEE Paper Study
Optical character recognition IEEE Paper StudyOptical character recognition IEEE Paper Study
Optical character recognition IEEE Paper Study
Er. Ashish Pandey
 
TLCS-900/H1 Microcontroller
TLCS-900/H1 MicrocontrollerTLCS-900/H1 Microcontroller
TLCS-900/H1 Microcontroller
Er. Ashish Pandey
 
MSP432P401x Microcontroller
MSP432P401x MicrocontrollerMSP432P401x Microcontroller
MSP432P401x Microcontroller
Er. Ashish Pandey
 
GSM Traffic Cases
GSM Traffic CasesGSM Traffic Cases
GSM Traffic Cases
Er. Ashish Pandey
 
Development of Open Telematics Service Based on Gateway and Framework
Development of Open Telematics Service Based on  Gateway and FrameworkDevelopment of Open Telematics Service Based on  Gateway and Framework
Development of Open Telematics Service Based on Gateway and Framework
Er. Ashish Pandey
 
Telecom Billing
Telecom BillingTelecom Billing
Telecom Billing
Er. Ashish Pandey
 
Automatic Speech Recognition
Automatic  Speech RecognitionAutomatic  Speech Recognition
Automatic Speech Recognition
Er. Ashish Pandey
 
“Temperature Sensors” Thermocouple | Thermistor | Resister Temperature Detectors
“Temperature Sensors” Thermocouple | Thermistor | Resister Temperature Detectors“Temperature Sensors” Thermocouple | Thermistor | Resister Temperature Detectors
“Temperature Sensors” Thermocouple | Thermistor | Resister Temperature Detectors
Er. Ashish Pandey
 
Mobile Sensors and Types
Mobile Sensors and TypesMobile Sensors and Types
Mobile Sensors and Types
Er. Ashish Pandey
 
BRAND ENDORSEMENTS BY SALMAN KHAN
BRAND ENDORSEMENTS BY SALMAN KHANBRAND ENDORSEMENTS BY SALMAN KHAN
BRAND ENDORSEMENTS BY SALMAN KHAN
Er. Ashish Pandey
 
Study of Data sheet of 56824 DSP processors
Study of Data sheet of 56824 DSP processorsStudy of Data sheet of 56824 DSP processors
Study of Data sheet of 56824 DSP processors
Er. Ashish Pandey
 
Audio and Video Compression
Audio and Video CompressionAudio and Video Compression
Audio and Video Compression
Er. Ashish Pandey
 
Making of constitution of India
Making of constitution of IndiaMaking of constitution of India
Making of constitution of India
Er. Ashish Pandey
 
Fundamental rights and duties
Fundamental rights and dutiesFundamental rights and duties
Fundamental rights and duties
Er. Ashish Pandey
 
Fundamental Rights
Fundamental RightsFundamental Rights
Fundamental Rights
Er. Ashish Pandey
 
Automated Face Recognition System for Office Door Access Control Application
Automated Face Recognition System for Office Door Access Control Application Automated Face Recognition System for Office Door Access Control Application
Automated Face Recognition System for Office Door Access Control Application
Er. Ashish Pandey
 
Configuration of CB Ce cc Poster
Configuration of CB Ce cc PosterConfiguration of CB Ce cc Poster
Configuration of CB Ce cc Poster
Er. Ashish Pandey
 
Satallite mobile communication Poster
Satallite mobile communication PosterSatallite mobile communication Poster
Satallite mobile communication Poster
Er. Ashish Pandey
 
ABCD parameter poster
ABCD parameter posterABCD parameter poster
ABCD parameter poster
Er. Ashish Pandey
 

More from Er. Ashish Pandey (20)

Salman Khan's Top 10 Best Films
Salman Khan's Top 10 Best FilmsSalman Khan's Top 10 Best Films
Salman Khan's Top 10 Best Films
 
Optical character recognition IEEE Paper Study
Optical character recognition IEEE Paper StudyOptical character recognition IEEE Paper Study
Optical character recognition IEEE Paper Study
 
TLCS-900/H1 Microcontroller
TLCS-900/H1 MicrocontrollerTLCS-900/H1 Microcontroller
TLCS-900/H1 Microcontroller
 
MSP432P401x Microcontroller
MSP432P401x MicrocontrollerMSP432P401x Microcontroller
MSP432P401x Microcontroller
 
GSM Traffic Cases
GSM Traffic CasesGSM Traffic Cases
GSM Traffic Cases
 
Development of Open Telematics Service Based on Gateway and Framework
Development of Open Telematics Service Based on  Gateway and FrameworkDevelopment of Open Telematics Service Based on  Gateway and Framework
Development of Open Telematics Service Based on Gateway and Framework
 
Telecom Billing
Telecom BillingTelecom Billing
Telecom Billing
 
Automatic Speech Recognition
Automatic  Speech RecognitionAutomatic  Speech Recognition
Automatic Speech Recognition
 
“Temperature Sensors” Thermocouple | Thermistor | Resister Temperature Detectors
“Temperature Sensors” Thermocouple | Thermistor | Resister Temperature Detectors“Temperature Sensors” Thermocouple | Thermistor | Resister Temperature Detectors
“Temperature Sensors” Thermocouple | Thermistor | Resister Temperature Detectors
 
Mobile Sensors and Types
Mobile Sensors and TypesMobile Sensors and Types
Mobile Sensors and Types
 
BRAND ENDORSEMENTS BY SALMAN KHAN
BRAND ENDORSEMENTS BY SALMAN KHANBRAND ENDORSEMENTS BY SALMAN KHAN
BRAND ENDORSEMENTS BY SALMAN KHAN
 
Study of Data sheet of 56824 DSP processors
Study of Data sheet of 56824 DSP processorsStudy of Data sheet of 56824 DSP processors
Study of Data sheet of 56824 DSP processors
 
Audio and Video Compression
Audio and Video CompressionAudio and Video Compression
Audio and Video Compression
 
Making of constitution of India
Making of constitution of IndiaMaking of constitution of India
Making of constitution of India
 
Fundamental rights and duties
Fundamental rights and dutiesFundamental rights and duties
Fundamental rights and duties
 
Fundamental Rights
Fundamental RightsFundamental Rights
Fundamental Rights
 
Automated Face Recognition System for Office Door Access Control Application
Automated Face Recognition System for Office Door Access Control Application Automated Face Recognition System for Office Door Access Control Application
Automated Face Recognition System for Office Door Access Control Application
 
Configuration of CB Ce cc Poster
Configuration of CB Ce cc PosterConfiguration of CB Ce cc Poster
Configuration of CB Ce cc Poster
 
Satallite mobile communication Poster
Satallite mobile communication PosterSatallite mobile communication Poster
Satallite mobile communication Poster
 
ABCD parameter poster
ABCD parameter posterABCD parameter poster
ABCD parameter poster
 

Recently uploaded

Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 

Recently uploaded (20)

Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 

Program, Code of Program and Screen Shot of Output (UNIVERSAL DRIVER USING µc P89c51)

  • 1. Raisoni College of Engineering An Autonomous Institution under UGC Act 1965 |Accredited by NBA & NAAC ‘A’ Grade DEPARTMENT OF ELECTRONICS AND TELECOMMUNICATION ENGINEERING Session: 2015-2016 (EVEN Semester) Semester/Branch/Section: –VII / ETC – C Name of Subject: Embedded System TAE 3 Report on: Program, Code of Program and Screen Shot of Output (UNIVERSAL DRIVER USING µc P89c51) Submitted by: Akash Shahu (Roll No. 26) Ashish Pandey (Roll No. 30) Sumitted To: Prof. S. Nimkar E&TC Department, G.H.R.C.E.
  • 2. Report on: Program, Code of Program and Screen Shot of Output UNIVERSAL DRIVER USING µc P89c51 INTRODUCTION: * Motors are considered as one of the most importantpart of an Industry. All the functions of the industries works on different types of motors. There are various types of motors being used in industry depending upon its application. The Ac and Dc motor required different type of controller to control the speed of motor . * But actually our aim to design universaldrive controller. * The Whole hardwarestructurecan be processed in a single central unit and can be termed as a universalcontroller. Temperature sensors, Currentsensors, Speed sensors etc can be included into the hardwareas per the application requirement . Block Diagram:
  • 3. Methodology: There are two methods used while designing the controller DC Controller: For DC motor control is done by using a simple voltage divider method. AC Controller:  Why use PWMfor speed variation?  When an AC motor is connected directly to an AC line (415V 3Φfor example) the motor speed is fixed and is calculated as follows  𝑛𝑠=120∗𝑓/𝑝 − 𝑠𝑙𝑖𝑝  ns = Motor speed (RPM)  f = fundamental frequency(Hz)  p = no. of poles Controller DC Motor Control AC Motor Control
  • 4. 8051 micro-controller(P89V51RD2): Features:-  8051 Central Processing Unit  5 V Operating voltage from 0 to 40 MHz  64kBof on-chip Flash program memory  Supports12-clock/6-clockmode  SPI(SerialPeripheralInterface)  Three 16-bit timers/counters  TTL- and CMOS-compatiblelogic levels  RXD/TXD Pins available
  • 5. L293D (Motor Driver IC):  Wide Supply-VoltageRange: 4.5 V to 36 V.  Separate Input-Logic Supply.  Thermal Shutdown.  High-Noise-Immunity Inputs.  Peak OutputCurrent 2 A Per Channel (1.2 A for L293D)
  • 6. Software Required:  FLASH MAGIC - This softwarehelps to dump the program opcodes to the microcontroller. This allows easy access to all the ISP features by the device. i.e. programming the flash memory, Reading from flash memory.  Embedded PCB Designer - This will help for designing the circuit on the printed circuit board.  MATLAB version2012–This softwarewould providea graphicaluser interface (GUI) between machine and man it will be used for creating a graphical user interface for the application with the help of components available on the window. The application softwareto interface hardware systemconnected to PC using COM ports and provideGUI interface. Advantages  A controller design for Torquecontrol of AC & DC motor  Starter-less operation.  The Whole hardwarestructurecan be Reconfigurable as universal controller.  This controller also gives an intelligent motor control (IMC) operation.  Speed control of any motor is important because required speed to accomplish a specific task Application  This systemmay be used to run High graded IndustrialMotors according to speed requirement.  Both AC as well as DC Drive will be in on system.  The systemwill be softwarecontrolled. So the user can enable or disable the systemfromhis/her office room.
  • 7. Screen Shot: OPERATING SCHEME  When both motor are off:- When DC is operating
  • 8. When AC motor is operating Coding/Programming in MATLAB Tool: -------------------------------------------------------------- ; TRIAC -> P1.0 || ZERO CREOSING ->P3.7 ; FIRE OFF TIMING : 4ms, 8ms,12ms, 16ms ;------------------------------------------------------------ $MOD51 TRIAC EQU P1.0 HIGH_TIMEEQU R0 LOW_TIMEEQU R1 RELAY_12V EQU P0.0 RELAY_9V EQU P0.1 RELAY_5V EQU P0.2 MOV P0,#0FFH ; INTIALLYALL RELAYOFF CLR TRIAC ; INITALLYMAKEMOTOR OFF
  • 9. MOV P2,#0FFH ; MAKE PULLUP HIGH MOV P3,#0FFH ; MAKE SENS DATA HIGH MOV TMOD,#21H ; TIMER 0 SELECTED, enabletimer1, mode2 (autoreload) MOV TH0,#0FFH ; LOAD VALUE MOV TL0,#0FEH MOV TH1,#0FDH ;9600 Baud rate MOV SCON,#50H ;8 bit, 1 stopbit, REN enabled SETB TR1 MOV R7,#00H ;USED TO ENABLE LOOP MOV SBUF,A JNB TI,$ CLR TI START: JNB RI,$ CLR RI MOV A,SBUF SJMP KEY_1 CHECK_KEYS: JNB RI,CHECK_SENSOR CLR RI MOV A,SBUF SJMP KEY_1 CHECK_SENSOR: CJNER7,#01H,CHECK_KEYS MOV TH0,HIGH_TIME ; LOAD DEFAUL VALUE MOV TL0,LOW_TIME CLR TF0 ; CLEAR TF0 FLAG CLR TRIAC ; OFF TRAIC SETB TR0 ; START TIMER 0
  • 10. JNB TF0,$ ; WAITTILL FLAG SETI.E.(ALPHAANGLEFOR FIRING) SETB TRIAC ; BETA ANGLE SJMP CHECK_KEYS ;----------------------------------------------------------- ; 13ms =>65536uS -13000uS =>52536uS =>DD38 =>25%SPEED ;----------------------------------------------------------- KEY_1: CJNEA,#'5',KEY_2 MOV HIGH_TIME,#0CDH MOV LOW_TIME,#38H MOV R7,#01H LJMP CHECK_KEYS ;----------------------------------------------------------- ; 10ms =>65536uS -10000uS =>55536uS =>D8F0 =>50% SPEED ;----------------------------------------------------------- KEY_2: CJNEA,#'6',KEY_3 MOV HIGH_TIME,#0D8H MOV LOW_TIME,#0F0H MOV R7,#01H LJMP CHECK_KEYS ;----------------------------------------------------------- ; 8ms =>65536uS - 4000uS =>61536uS =>F060 =>75% SPEED ;----------------------------------------------------------- KEY_3: CJNEA,#'7',KEY_4 MOV HIGH_TIME,#0F0H MOV LOW_TIME,#60H MOV R7,#01H LJMP CHECK_KEYS ;----------------------------------------------------------- ; 0.05ms =>65536uS -50uS =>65486uS =>FFCE=>100% SPEED ;-----------------------------------------------------------
  • 11. KEY_4: CJNEA,#'8',AC_OFF MOV HIGH_TIME,#0FFH MOV LOW_TIME,#0CEH MOV R7,#01H LJMP CHECK_KEYS AC_OFF: CJNEA,#'9',DC_5V CLR TRIAC MOV R7,#00H LJMP CHECK_KEYS ;############################################################ ; DC MOTOR ;############################################################ DC_5V: CJNEA,#'2',DC_9V SETB RELAY_12V ;OFF RELAY SETB RELAY_9V ;OFF RELAY CLR RELAY_5V DC_9V: CJNEA,#'1',DC_12V SETB RELAY_12V ;OFF RELAY SETB RELAY_5V ;OFF RELAY CLR RELAY_9V DC_12V: CJNEA,#'3',DC_OFF SETB RELAY_9V ;OFF RELAY SETB RELAY_5V ;OFF RELAY CLR RELAY_12V DC_OFF: CJNEA,#'4',ALL_OFF SETB RELAY_12V ;OFF RELAY SETB RELAY_9V ;OFF RELAY SETB RELAY_5V
  • 12. ALL_OFF: CJNEA,#'0',RETURN_KEY CLR TRIAC MOV R7,#00H SETB RELAY_12V ;OFF ALL RELAY SETB RELAY_9V SETB RELAY_5V, RETURN_KEY: LJMP CHECK_KEYS ;******************************************************************* ; SERIAL SETTINGS FUNCTION ;******************************************************************* SERIAL: MOV TMOD,#20H ;enable timer1, mode2 (auto reload) MOV TH1,#0FDH ;9600 Baud rate MOV SCON,#50H ;8 bit, 1 stopbit, REN enabled SETB TR1 RET ;******************************************************************* ; FUNCTION FOR SENDING CHARACTER ;******************************************************************* SEND_CHAR: MOV SBUF,A JNB TI,$ CLR TI RET ;******************************************************************* ; FUNCTION FOR RECEIVING CHARACTER ;******************************************************************* RECV_CHAR: JNB RI,$ CLR RI MOV A,SBUF RET
  • 13. ;------------------------------------------------------------ ; TRIAC -> P1.0 || ZERO CREOSING ->P3.7 ; FIRE OFF TIMING : 4ms, 8ms,12ms, 16ms ;------------------------------------------------------------ $MOD51 TRIAC EQU P1.0 HIGH_TIMEEQU R0 LOW_TIMEEQU R1 RELAY_12V EQU P0.0 RELAY_9V EQU P0.1 RELAY_5V EQU P0.2 MOV P0,#0FFH ; INTIALLYALL RELAYOFF CLR TRIAC ; INITALLYMAKEMOTOR OFF MOV P2,#0FFH ; MAKE PULLUP HIGH MOV P3,#0FFH ; MAKE SENS DATA HIGH MOV TMOD,#21H ; TIMER 0 SELECTED, enabletimer1, mode2 (autoreload) MOV TH0,#0FFH ; LOAD VALUE MOV TL0,#0FEH MOV TH1,#0FDH ;9600 Baud rate MOV SCON,#50H ;8 bit, 1 stopbit, REN enabled SETB TR1 MOV R7,#00H ;USED TO ENABLE LOOP MOV SBUF,A JNB TI,$ CLR TI START: JNB RI,$ CLR RI MOV A,SBUF SJMP KEY_1 CHECK_KEYS: JNB RI,CHECK_SENSOR CLR RI
  • 14. MOV A,SBUF SJMP KEY_1 CHECK_SENSOR: CJNER7,#01H,CHECK_KEYS MOV TH0,HIGH_TIME ; LOAD DEFAUL VALUE MOV TL0,LOW_TIME CLR TF0 ; CLEAR TF0 FLAG CLR TRIAC ; OFF TRAIC SETB TR0 ; START TIMER 0 JNB TF0,$ ; WAITTILL FLAG SETI.E.(ALPHAANGLEFOR FIRING) SETB TRIAC ; BETA ANGLE SJMP CHECK_KEYS ;----------------------------------------------------------- ; 13ms =>65536uS -13000uS =>52536uS =>DD38 =>25%SPEED ;----------------------------------------------------------- KEY_1: CJNEA,#'5',KEY_2 MOV HIGH_TIME,#0CDH MOV LOW_TIME,#38H MOV R7,#01H LJMP CHECK_KEYS ;----------------------------------------------------------- ; 10ms =>65536uS -10000uS =>55536uS =>D8F0 =>50% SPEED ;----------------------------------------------------------- KEY_2: CJNEA,#'6',KEY_3 MOV HIGH_TIME,#0D8H MOV LOW_TIME,#0F0H MOV R7,#01H LJMP CHECK_KEYS ;----------------------------------------------------------- ; 8ms =>65536uS - 4000uS =>61536uS =>F060 =>75% SPEED ;-----------------------------------------------------------
  • 15. KEY_3: CJNEA,#'7',KEY_4 MOV HIGH_TIME,#0F0H MOV LOW_TIME,#60H MOV R7,#01H LJMP CHECK_KEYS ;----------------------------------------------------------- ; 0.05ms =>65536uS -50uS =>65486uS =>FFCE=>100% SPEED ;----------------------------------------------------------- KEY_4: CJNEA,#'8',AC_OFF MOV HIGH_TIME,#0FFH MOV LOW_TIME,#0CEH MOV R7,#01H LJMP CHECK_KEYS AC_OFF: CJNEA,#'9',DC_5V CLR TRIAC MOV R7,#00H LJMP CHECK_KEYS ;############################################################ ; DC MOTOR ;############################################################ DC_5V: CJNEA,#'2',DC_9V SETB RELAY_12V ;OFF RELAY SETB RELAY_9V ;OFF RELAY CLR RELAY_5V DC_9V: CJNEA,#'1',DC_12V SETB RELAY_12V ;OFF RELAY SETB RELAY_5V ;OFF RELAY CLR RELAY_9V DC_12V:
  • 16. CJNEA,#'3',DC_OFF SETB RELAY_9V ;OFF RELAY SETB RELAY_5V ;OFF RELAY CLR RELAY_12V DC_OFF: CJNEA,#'4',ALL_OFF SETB RELAY_12V ;OFF RELAY SETB RELAY_9V ;OFF RELAY SETB RELAY_5V ALL_OFF: CJNEA,#'0',RETURN_KEY CLR TRIAC MOV R7,#00H SETB RELAY_12V ;OFF ALL RELAY SETB RELAY_9V SETB RELAY_5V, RETURN_KEY: LJMP CHECK_KEYS ;******************************************************************* ; SERIAL SETTINGS FUNCTION ;******************************************************************* SERIAL: MOV TMOD,#20H ;enable timer1, mode2 (auto reload) MOV TH1,#0FDH ;9600 Baud rate MOV SCON,#50H ;8 bit, 1 stopbit, REN enabled SETB TR1 RET ;******************************************************************* ; FUNCTION FOR SENDING CHARACTER ;******************************************************************* SEND_CHAR: MOV SBUF,A JNB TI,$
  • 17. CLR TI RET ;******************************************************************* ; FUNCTION FOR RECEIVING CHARACTER ;******************************************************************* RECV_CHAR: JNB RI,$ CLR RI MOV A,SBUF RET