Microcontroller › 8051 › how to use 89C51 to dirve motor to 17 difrent places & on every place it should stop
- This topic has 0 replies, 1 voice, and was last updated 12 years, 11 months ago by ZOBI.
-
AuthorPosts
-
December 26, 2011 at 12:48 pm #1468ZOBIParticipant
i want to make a program which drive a motor to 17 different places an stop on every place then ti will remain there at a given timer value , program will start in this way that at 1st operator or USER will enter timer value for example 10 mins for sensor 1 (1st place where motor should stop) then enter the value 1 hour for sensor 2 2nd place where motor should stop) and son on for further remaining sensors, after all values are given by User/operator then the motor will move and stop at sensor 1 spends its given time and then move to sensor 2 and so on , problem is how should i use 8 registers of 89C51 for saving timer or DELAY values for 17 sensors if it is only 1 or 2 sensor 1 will be easy but how will save all 17 sensor values using 89C51 registers
this is the program written in ASSEMBLY language this program will move 2 motors 1st X axis motor then stop at sensor then move Y AXIS motor in downward direction then remains there at User given time then after that move upward then x-axis motor , The line “Chamber_delay:” is that line after that line the user given Delay /timer value will be placed . please help me out how to put that value this program will be written same for 17 times for 17 sensors , this is for checking purpose work for only 1 sensor
org 000h
clr p1.0
clr p1.2
clr p1.4setb p1.0 ;1 starts motor x in forward direction
Lp1: JB p1.1,Lp1 ;Continue to move motor as long as p1.1 is high
clr p1.0 ;1 stops motor x
setb p1.2 ;1 starts motor y in downward direction
Lpp1: JB p1.3,Lpp1 ;Continue to move motor as long as p3.0 is high
clr p1.2 ;1 stops motor y
Chamber_delay:setb p1.4 ;1 starts motor y in upward direction
Lpp2: JB p1.5,Lpp2 ;Continue to move motor as long as p1.5 is high
clr p1.4end
-
AuthorPosts
- You must be logged in to reply to this topic.