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 / interfacing servo motor with 8051

interfacing servo motor with 8051

|

Microcontroller › 8051 › interfacing servo motor with 8051

  • This topic has 8 replies, 5 voices, and was last updated 11 years, 1 month ago by Rohit.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • January 17, 2015 at 7:04 pm #3405
    Iqbal Muhammad
    Participant

    hi.. i am having troubles with inetrfacing sevo with 89c51,, i am having the proteus simulation working fine… if any one have the knowledge, please share with me,,..

    January 18, 2015 at 11:16 am #12524
    ameersultan145
    Participant

    i have the same problem , servo can’t rotate ,simulation works but practical not.frown

    January 25, 2015 at 8:41 am #12538
    Ashutosh Bhatt
    Participant

    post your hardware circuit and post your program

    January 26, 2015 at 8:42 am #12540
    Iqbal Muhammad
    Participant

    here is the diagram…

    wysiwyg_imageupload:14311:

    January 26, 2015 at 11:51 am #12541
    murugan bala
    Participant

    connect the 9th pin (reset pin) into powersupply .i.e 5V

    January 26, 2015 at 3:06 pm #12542
    Iqbal Muhammad
    Participant

    here is the code:

     

    // Program to rotate servo by 5 degree from previous position starting from 0 degree
     
    // 0 degree = 700us 
    // 180 degree = 5500us
    // Timer1 pulse after 50us -23
     
    #include<reg51.h>
    sbit output=P1^0;   //Output to motor
    int count;
     
    void delay(unsigned int msec)   // Function for delay
    {
    int i,j;
    for(i=0;i<msec;i++)
    for(j=0;j<1275;j++);
    } 
     
    void timer(int msec) // Function for timer
    {
    int i;
    TR1=1;
    for(i=0;i<msec;i++)
    {
    while(TF1==0);
    TF1=0;
    }
    TR1=0;
    }
    void main()
    {
    int i;
    TMOD=0x20; // Mode2
    TH1= -23; // 50usec timer
    output=0;
    count=14;
    while(1)
    {
    if(count>=100)
    count=14;
    else
    count=count+5;
    for(i=0;i<200;i++)
    {
    output=1;
    timer(count);
    output=0;
    timer(360);
    }
    delay(100);
    }
    }
    January 26, 2015 at 3:08 pm #12543
    Iqbal Muhammad
    Participant

    it works in proteus simulation but not working upon hardware connections……

    January 29, 2015 at 9:53 am #12549
    Ashutosh Bhatt
    Participant

    first check output at p1.0 pin of micro controller

    then check output from LM324

    check whether you are getting pulses or not on CRO

    February 14, 2015 at 11:26 am #12590
    Rohit
    Participant

    use the debugger to check weather the registers are getting right values or not….

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

RSS Recent Posts

  • cpap change over circuit March 14, 2026
  • Fender rumble 100 base amp, power, light and overdrive light flash repeatedly when power turned on no output March 13, 2026
  • Phone to op amp circuit? March 13, 2026
  • Arduino standalone minimal March 13, 2026
  • Project boxes March 13, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 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