SlideShare a Scribd company logo
1 of 17
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 programmingEngr Alam
 
174085193 pic-prgm-manual
174085193 pic-prgm-manual174085193 pic-prgm-manual
174085193 pic-prgm-manualArun Shan
 
DCS PRESENTATION
DCS PRESENTATIONDCS PRESENTATION
DCS PRESENTATIONbvent2005
 
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 LtdMarsus 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 StepsTolomatic
 
Siemens Automation Station Compact Model PXC52
Siemens Automation Station Compact Model PXC52Siemens Automation Station Compact Model PXC52
Siemens Automation Station Compact Model PXC52CONTROLS & 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 AMC22Electromate
 
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 omronAlain Hua
 
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.54Subhash Mahla
 
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 vfdmanishrair
 

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)

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
Basic plcBasic plc
Basic plc
 
Basic PLC.ppt
Basic PLC.pptBasic PLC.ppt
Basic PLC.ppt
 
embedded system
embedded systemembedded system
embedded system
 
n5acb0f1c011fb.pdf
n5acb0f1c011fb.pdfn5acb0f1c011fb.pdf
n5acb0f1c011fb.pdf
 
At89 c2051 (3)
At89 c2051 (3)At89 c2051 (3)
At89 c2051 (3)
 
89 c2051
89 c205189 c2051
89 c2051
 
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 FilmsEr. Ashish Pandey
 
Optical character recognition IEEE Paper Study
Optical character recognition IEEE Paper StudyOptical character recognition IEEE Paper Study
Optical character recognition IEEE Paper StudyEr. 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 FrameworkEr. Ashish Pandey
 
Automatic Speech Recognition
Automatic  Speech RecognitionAutomatic  Speech Recognition
Automatic Speech RecognitionEr. 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 DetectorsEr. Ashish Pandey
 
BRAND ENDORSEMENTS BY SALMAN KHAN
BRAND ENDORSEMENTS BY SALMAN KHANBRAND ENDORSEMENTS BY SALMAN KHAN
BRAND ENDORSEMENTS BY SALMAN KHANEr. 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 processorsEr. Ashish Pandey
 
Making of constitution of India
Making of constitution of IndiaMaking of constitution of India
Making of constitution of IndiaEr. Ashish Pandey
 
Fundamental rights and duties
Fundamental rights and dutiesFundamental rights and duties
Fundamental rights and dutiesEr. 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 PosterEr. Ashish Pandey
 
Satallite mobile communication Poster
Satallite mobile communication PosterSatallite mobile communication Poster
Satallite mobile communication PosterEr. 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

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 

Recently uploaded (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

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