To drive a DC motor.

Hi,
Can anyone please give a C program for 8051 that can drive two DC motors with time delay?? That is two motors have to run for 5secs and stop for 5 secs. I have a program to interface the motors using l293d but cannot understand how to implement the timer for running and stopping.

</i PLEASE HELP>

Parents
  • People can give the code, Its simple just try yourself, people are there to help you.

    Write a delay instead of timer(for your application),

    Use simple instructions to build delay, how??

    Ex: MOV R0,#01h - > 1 X 1.085uSec (1 Machine cycle)

    MUL AB - > 4 X 1.085uSec (4 Machine cycle)

    Since the above code will take 5.425uSec, Just calculate how many times do you need to execute the above code to get 5Sec delay

    All the best

Reply
  • People can give the code, Its simple just try yourself, people are there to help you.

    Write a delay instead of timer(for your application),

    Use simple instructions to build delay, how??

    Ex: MOV R0,#01h - > 1 X 1.085uSec (1 Machine cycle)

    MUL AB - > 4 X 1.085uSec (4 Machine cycle)

    Since the above code will take 5.425uSec, Just calculate how many times do you need to execute the above code to get 5Sec delay

    All the best

Children
More questions in this forum