Hello,
I am trying to drive servo motor MG996R maximum angular rotation is 120º in three positions 0º , 60º , 120º degree with 3 push button switches SW1, SW2 and SW3. I tried the code but i do not get the exact position of servo motor.
The problem is that I do not know the exact value of PR2 with TIMER2 . I do not have OSC or logic analyzer to measure. Period ms with timer2 interrupt routine. I have the code compiled with XC8 and schematic diagram of circuit.
I appreciate any help! Thank you very much.
I am trying to drive servo motor MG996R maximum angular rotation is 120º in three positions 0º , 60º , 120º degree with 3 push button switches SW1, SW2 and SW3. I tried the code but i do not get the exact position of servo motor.
The problem is that I do not know the exact value of PR2 with TIMER2 . I do not have OSC or logic analyzer to measure. Period ms with timer2 interrupt routine. I have the code compiled with XC8 and schematic diagram of circuit.
I appreciate any help! Thank you very much.
Attachments
-
2.2 KB Views: 26
-
34 KB Views: 16