Not sure why you are using a pulse width value higher than period value; As those statements, will result in your PWM output to be high all the time (if Compare type is selected as Less than) and also for a 8-bit PWM, you can only write a period/pulsewidth of value >255;

Now getting back to your requirement - Is it possible for you to send us the servo motor's datasheet? I can help you in getting the PWM configured properly for the same.

If the requirement is to achieve 60deg revolution in 0.131 sec, then motor needs to be moved by one step in (0.786/TOTAL_MOTOR_STEPS) sec. So, configure a timer to generate this much delay and at each timer interrupt, update the motor step sequence.

Also, you have to tune the PWM duty cycle to acheive the required torque.

I believe the spec you are mentioning is the rate at which the servo turns.

We need the pulse timing details, for generating the PWM to hold the servo in a specific angle. If you let us know the datasheet or make of the servo you are using, it will be useful. For instance in the datatsheet of this servo, you can see the timing graph provided on Page 3. We would need a similar data for the servo you are using, to provide exact PWM configuration.

For the motor in the mentioned link, you can use the PWM settings i provided in my previous comments. And most of the servos, have pulse frequency of 50Hz (20 ms) only the pulse duration for a particular angle would be different across servos and that is what is required here for PWM setting.

Since you are a beginner, it will be very helpful for you not to try out everything, but focus on understanding what you are doing.

We are talking about a PWM which has several parameters that affect its performance.

Dana was talking about "Period" which as we suggested should be fixed at 20ms giving a frequency of 50Hz.

The PWM period for your application should be fixed and not cjhanged within the program. It is calculated by dividing the input-frequency of your PWM by (preiod-value +1) givint the output frequency. 1/frewquency is period , you hopefully know.

Next parameter in a PWM is the "pulse width" which is often referred to as "Duty-cycle". In your appllication the Pulse width has to be between 1 ms and 2 ms and must vary between thos values to move the servo.

A simple calculation which I would like to leave in your hands will relieve the valid range of values which you can send to the PWM by using the API PWM8_1_WritePulseWidth().

The delay you used to watch motor movement is just a thenth of a second which might be too short for the device to reach its wanted position, I would suggest to use a much longer delay at first Do not stop the PWM! some servos are diving into a fixed position when the pulses are not updated every 20ms.

So putting it all together I would suggest you to read and understand the datasheets, understand the APIs, understand the math behind and use it accordingly.

In the case that there are no timing diagrams provided, we can try 1.5 ms for center position and any position less than 1.5 ms is going to move the rotor angel to a position less than 90 and above 1.5 ms it will be more than 90 degrees. Since we do not know the exact values we need to figure the limits by experiments.

You can play around with the pulse width values to see how far the rotor turns and make a note of the limits to use in your final design. Also note that the 1.5 ms center position pulse is arbitrarily chosen as that is the most common width for a center pulse in most servos. You can verify that too by observation.