1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

DC Motor with 8051 using L293D

Discussion in '8051/8951' started by nikzhafran, Sep 21, 2015.

  1. nikzhafran

    nikzhafran New Member

    Joined:
    Feb 19, 2015
    Messages:
    10
    Likes:
    1
    [​IMG]

    I want to make control when press pushbutton p2.0 and pin p3.0 turn on when release pushbutton p2.0 it will stop ...

    pushbutton p2.0 control motor p3.0
    pushbutton p2.1 control motor p3.1
    pushbutton p2.2 control motor p3.2
    pushbutton p2.3 control motor p3.3

    I have make a program but it only p3.0 on .......
    Can anyone help me ?


    Code (text):
              ORG 00H
            MOV A,00H
            MOV P2,A
            MOV P3,A

    MAIN:  
            JB P2.0 , DPNKN
            ACALL DELAY
            SJMP MAIN


    DPNKN:    CLR P3.1
            SETB P3.0
            ACALL DELAY
            CLR P3.1
            SJMP MAIN1

    MAIN1:  
            JB P2.1 , DPNKN1
            ACALL DELAY
            SJMP MAIN


    DPNKN1:    CLR P3.1
            SETB P3.1
            ACALL DELAY
            SJMP MAIN2

    MAIN2:  
            JB P2.0 , DPNKN2
            ACALL DELAY
            SJMP MAIN


    DPNKN2:    CLR P3.1
            SETB P3.0
            ACALL DELAY
            CLR P3.1
            SJMP MAIN3

    MAIN3:  
            JB P2.1 , DPNKN3
            ACALL DELAY
            SJMP MAIN


    DPNKN3:    CLR P3.1
            SETB P3.1
            ACALL DELAY
            SJMP MAIN

    DELAY:     MOV R3,#250
    HERE2:     MOV R4,#250
    HERE:     DJNZ R4,HERE
            DJNZ R3,HERE2
            RET
            END
     
     
  2. atif123

    atif123 Member

    Joined:
    Aug 7, 2009
    Messages:
    59
    Likes:
    0
    hi brother . i make a project for u . c code +protues+hex file
     

    Attached Files:

  3. paridhi jain

    paridhi jain New Member

    Joined:
    Sep 2, 2015
    Messages:
    27
    Likes:
    0
    what is motto of this code.
     

Share This Page