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 / servo not working

servo not working

|

Microcontroller › AVR › servo not working

  • This topic has 1 reply, 2 voices, and was last updated 12 years, 8 months ago by AJISH ALFRED.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • August 20, 2012 at 4:11 am #1918
    swapnil_s
    Participant

     

     

    avr studio 5.

     

     

    #defineF_CPU16000000

    #include<avr/io.h>

    #include<util/delay.h>

     

    intmain(void)

    {   DDRD=0xff;

           TCCR1A=0b10100001;

           TCCR1B=0b00001010;

           ICR1=20000;

          

        while(1)

        { 

                          

           OCCR1A=1000;

           _delay_ms(10);

      

     

       }

    }

     

    I took prescalar =8,

    Therefore for generating  50hz  frequency , ICR1=20000,

    1ms= full left= 2.5hz     occr1a=1000

    1.5ms=middle=3.75hz     occr1a=1500

    2ms=full right=5hz    occr1a=2000

     But the servo is not working…!!
    whatz wrong in the code??

    September 12, 2012 at 5:14 pm #8577
    AJISH ALFRED
    Participant

    Hi,

    Please comment your code properly and post again, so that it would be easy for us to help you

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

RSS Recent Posts

  • 100uF bypass Caps? May 19, 2025
  • Fuel Auto Shutoff May 18, 2025
  • Actin group needed for effective PCB software tutorials May 18, 2025
  • how to work on pcbs that are thick May 18, 2025
  • compatible eth ports for laptop May 18, 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