Society of Robots - Robot Forum

Software => Software => Topic started by: gorutiwari17 on September 10, 2013, 01:15:44 AM

Title: how to code servo motor PWM in c code
Post by: gorutiwari17 on September 10, 2013, 01:15:44 AM
hey bro.... i am using P89v51rd2 microcontroller....
so how to operate servoMotor.. program in embeded C
Title: Re: how to code servo motor PWM in c code
Post by: newInRobotics on September 10, 2013, 01:41:54 AM
If it's a hobby servo driven by PWM, then to drive it You need to generate 50Hz PWM wave, with pulse width between 1ms and 2ms. From quick Google search I did not find much information about how to generate PWM with P89v51rd2, making me think that P89v51rd2 is not a popular uC between hobbyists, meaning that You'll have to study datasheet Yourself as well as come up with Your own code.

--> P89V51RD2 Datasheet (http://www.keil.com/dd/docs/datashts/philips/p89v51rd2.pdf#page=50)
Title: Re: how to code servo motor PWM in c code
Post by: gorutiwari17 on September 12, 2013, 08:14:48 AM
thnx for response buddy........ i'll try to make it.. (y)