Embedded / RTOS

Moderators: None (Apply to moderate this forum)
Number of threads: 362
Number of posts: 665

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
running a stepper motor using a L293D driver from the 8051 processor Posted by nanajol on 31 Oct 2002 at 1:53 AM
this is the code that i wrote for running my stepper motor thru the L293D driver. the output is meant for running the stepper motor (generating a waveform with 4 outputs, being : 1) 1001
2) 0110
3) 1100
4) 0011 )
can anyone help me to check if the code is correct??? my motor doen't seem to run, nor even generate waveforms of the needed output. its urgent... can anyone help?

ORG 0000H
JMP MAIN
ORG 100H
MAIN: SETB P0.4
SETB P0.0
CLR P0.1
SETB P0.2
CLR P0.3
SETB P0.5
MOV TMOD,#01H
LOOP: MOV TH0,#0FEH
MOV TL0,#0CH
SETB TR0
WAIT: JNB TF0,WAIT
CLR TR0
CLR TF0
JB P0.5,ALT
CPL P0.0
CPL P0.1
CPL P0.5
ALT: CPL P0.2
CPL P0.3
CPL P0.5
JMP LOOP
END

thanx...



 

Recent Jobs