help me

SgtWookie

Joined Jul 17, 2007
22,230
OK, now figure out how to start the motor out stepping slowly in one direction, and then increase the speed smoothly and gradually to a much faster speed (less time between steps) - and then after running at full speed, slow the motor gently to a stop.

Your routine should be able to accept a number representing the total number of steps to take in one direction.

You should also post your schematic and the code you used at this point in order to have some record of your progress. If you don't post your schematic and your program code, it will be much harder to suggest where to go from here.
 
Last edited:

Thread Starter

mehtab102

Joined Jun 21, 2011
62
I try to some extent
ORG 00H
MOV P2,#00H
RUN:
SETB P2.0
ACALL DELAY1
CLR P2.1
ACALL DELAY1

SJMP RUN1



delay1:
MOV TMOD,#00000011H
AGAIN: MOV TL0,#000H
MOV TH0,#0EEH
SETB TR0
BACK: JNB TF0,BACK
CLR TR0
CLR TF0
ret
end
 

Thread Starter

mehtab102

Joined Jun 21, 2011
62
Org 00h
ljmp main

org 003h
setb p1.0
clr p1.1
mov r1,#100
here1:djnz r1,here1
reti
org 0013h
mov p2,#00h
start:
Mov p2,#0ch
acall delay

mov p2,#06h
acall delay

mov p2,#03h
acall delay

mov p2,#09h
acall delay

sjmp start


delay:
Mov r7,#4
wait2:
Mov r6,#0ffh
wait1:
Mov r5,#0ffh
wait:
Djnz r5,wait
djnz r6,wait1
djnz r7,wait2
ret
reti

org 00bh
mov tmod,#01h
mov th0,#0eeh
mov tl0,#0
setb tr0
again:jnb tf0,again
clr tf0
clr tr0
clr p1.0
clr p1.1

reti

main:
Mov ie,#10000111b
setb tr0
here:sjmp here
end

sir i write this code for dc motor and stepper motor..
Here is prob. That stepper is not running on interupt...
Plz help mke
 

SgtWookie

Joined Jul 17, 2007
22,230
Rich (BB code):
Org 00h
ljmp main

org 003h
setb p1.0
clr p1.1
mov r1,#100
here1:djnz r1,here1
reti
org 0013h
mov p2,#00h
start:
Mov p2,#0ch
acall delay

mov p2,#06h
acall delay

mov p2,#03h
acall delay

mov p2,#09h
acall delay

sjmp start


delay:
          Mov r7,#4
wait2:
        Mov r6,#0ffh
wait1:
        Mov r5,#0ffh
wait:
        Djnz r5,wait
        djnz r6,wait1
        djnz r7,wait2
        ret
        reti

org 00bh
mov tmod,#01h
mov th0,#0eeh
mov tl0,#0
setb tr0
again:jnb tf0,again
clr tf0
clr tr0
clr p1.0
clr p1.1

reti

main:
Mov ie,#10000111b
setb tr0
here:sjmp here
end
sir i write this code for dc motor and stepper motor..
Here is prob. That stepper is not running on interupt...
Plz help mke
I don't see any comments in your source code. Not one. Why did you not comment the code?
I don't see a schematic. Where is the schematic you are using now?
 

Thread Starter

mehtab102

Joined Jun 21, 2011
62
Sir just tell me tha can i use timer mode with interupts???
In my code there are two interupts
org 003h
&
org 0013h

and timer 0
org 00bh
 
Top