EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / L293D interfacing with 8051

L293D interfacing with 8051

|

Microcontroller › 8051 › L293D interfacing with 8051

  • This topic has 7 replies, 4 voices, and was last updated 11 years, 7 months ago by balaji.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • March 7, 2013 at 9:46 am #2167
    Ashwani Garg
    Participant

    This code is not workign ,why ?

    my circuit is also according to the program code,all pics are good and well checked.

     

    // Program to display dynamic text on LCD
    #include<reg51.h>
    #define msec 50
    sbit rs=P2^0;   //Register select (RS)
    sbit rw=P2^1;   //Read write (RW) pin
    sbit en=P2^2;   //Enable (EN) pin
    sbit m01=P2^3;    //input to L293D
    sbit m02=P2^4;     //input to L293D
    unsigned char commands[]={0x38,0x0E,0x01,0x06,’’};  //Command to be sent to LCD
    char name[]={“*ECE ROCKS*”};    //String to be displayed on LCD
    void delay(unsigned int time)  //Time delay function
    {
    unsigned int i,j;
    for(i=0;i<time;i++)
      for(j=0;j<1275;j++);
    }
    void lcdcmd(unsigned char value)  //Function for sending values to the command register of LCD
    {
    P1=value;
    rs=0;
    rw=0;
    en=1;
    delay(1);
    en=0;
    return;
    }
    void display(unsigned char value)  //Function for sending values to the data register of LCD
    {
    P1=value;
    rs=1;
    rw=0;
    en=1;
    delay(1);
    en=0;
    return;
    }
    void main()
    {
    int i,j;
    for(i=0;commands!=’’;i++)  //Sending string to LCD
    {
      lcdcmd(commands
    );
      delay(msec);
    }
    for(j=0;name[j]!=’’;j++)
    {
      display(name[j]);
      delay(msec);
    }
    m01=m02=0;
    delay(msec);

    while(1)
    {
    m01=1;
            m02=0;            // down
           
            delay(msec);       
           

             
            m01=0;
            m02=1;    // stop
            delay(msec);   

      lcdcmd(0x1C);  //Shift the entire display to right
      delay(75);
    }
    }
     

     

     

    March 7, 2013 at 5:15 pm #9275
    Vicky
    Participant

    Can you tell me what error message says ????

    March 7, 2013 at 5:58 pm #9279
    Ashwani Garg
    Participant

    wysiwyg_imageupload:7753:

    March 7, 2013 at 6:00 pm #9280
    Ashwani Garg
    Participant

    i am using AT89S52 CONTROLLER,,

     

    L293D MOTOR DRIVER

     

    16×2 LCD

     

    Two supply voltages for motor and IC’s.

     

    ,i don’t know,what is going wrong

    March 11, 2013 at 1:31 am #9290
    Vicky
    Participant

    In this above image there is no error find in your code. Tell me your problem exactly.

    March 25, 2013 at 6:25 am #9369
    Arjun Vaghani
    Participant

    /*motor.c*/

    /*try this out , it’s very simple*/

    /*LCD is not necessary for L293D’s interfacing with AT89S52, So i have not given, but u can add that code separately*/

     

    /*program-start*/

     

    #include<reg51.h>
    main()
    {
    while(1)
    {
    unsigned char t;
    t=P1&0x0f;                             //read the data from port P1
    switch(t)
    {                                              /*block for taking action according to input*/
    case 0x02:P2=0x85;            /*forward*/
     break;
    case 0x04:P2=0x86;          /*left*/
     break;
    case 0x06:P2=0x89;           /*right*/
     break;
    case 0x08:P2=0x8A;        /*backward*/
     break;
    case 0x05:P2=0x00;          /*stop*/
     break;
    case 0x00:P2=0x00;       /*no input*/
     break;
    }
    }
    }
     

    /*In Diagram Shown Below, by Configuring Port P1 for Different Input Combinations , U can get the Action Performed by the DC Motor, i.e Desired Motion.*/

     

    wysiwyg_imageupload:7864:

     

    March 25, 2013 at 1:17 pm #9371
    Ashwani Garg
    Participant

    Thank you very much Mr.Arjun

    December 10, 2013 at 11:18 am #10717
    balaji
    Participant

    HI ASHWANI

    i see your code of motor driver ,your code will be wrong that why its didn,t get uotput ,if keil it show no warning and no error according to her library only ,

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • Fixing board, Easy question HEX SCHMITT July 9, 2025
  • Can I make two inputs from one?? July 9, 2025
  • The Analog Gods Hate Me July 9, 2025
  • How to make string LEDs? July 9, 2025
  • It's Amazing What A Buck And A Quarter.... July 8, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise