Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[AVR] How to control Servo motor using ATMEGA32?

Status
Not open for further replies.

Narendra1190

Member level 2
Member level 2
Joined
Jan 23, 2014
Messages
44
Helped
6
Reputation
12
Reaction score
6
Trophy points
1,288
Visit site
Activity points
1,666
Hi,
I am using Atmega32 microcontroller with 8MHz external crystal oscillator and Servo motor of

Operating Voltage : 4.8-6.0V
PWM Input Range : Pulse Cycle 20±2ms, Positive Pulse 1~2ms
STD Direction : Counter Clockwise / Pulse Traveling 1500 to 1900µsec
Stall Torque : 3 Kgf.cm(41.3 oz/in) at 4.8V, 3.2 Kgf.cm(44 oz/in) at 6V
Operating Speed : 0.2 sec/ 60° at 4.8V, 0.18 sec/ 60° at 6V at no load
Weight : 38g (1.27 oz)
Size : 41.3*20.3*38.7*48.5*10
Plug Available : FUT, JR
Special Feature : Heavy Duty Plastic Gears, Economy Servo.


I want make servo to rotate 0 degree and 180 degree back and forth continuesly. how can i set timer and counter mode.i refered some tutorial but my motor rotatin continusly in one direction with around 10 degree..plz help me
 

try initially with some pulses from port pins using delay functions :) check if its working :)
Then u can try in timer mode by configuring registers or i think u can use PWM too
 

As mentioned, you can use delay functions to give you 1 mS to 2 mS (1.5 mS center) pulses for the full range of movement. However, not all servos are capable of 180° rotation. Those that are not capable of that degree of rotation can sometimes be modified. Some, unfortunately, cannot be modified.

So, before before allowing your servo stall at ±45 to 60° for a prolonged period, be sure to check whether it is capable of ±90° rotation.

Here's an informative link on that subject: **broken link removed**

The home site also has informative links on how servos work.

John
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top