FEZ Mini - Servo Driver Struggle

I am really struggling in getting my FEZ Mini to control a Servo. I am sure my code is correct and that I have things wired correctly.

Servo is connected to a 5V 1Amp supply
Di9 is connected to the Servo Signal

Servo supply and FEZ share a common ground

This is my Test Code:

PWM servo = new PWM((PWM.Pin)FEZ_Pin.PWM.Di9);
while (true)
{
servo.SetPulse(20000000, 1250 * 1000); // 0 degrees. 20ms period and 1.25ms high pulse
Thread.Sleep(1000);//wait for a second
servo.SetPulse(20000000, 1500 * 1000); // 90 degrees. 20ms period and 1.50ms high pulse
Thread.Sleep(1000);//wait for a second
servo.SetPulse(20000000, 1750 * 1000); // 180 degrees. 20ms period and 1.75ms high pulse
}

When I depoy and run this the Servo does not move. If I connect an LED to the signal the LED pulses dimmly as the PWM wave changes. I have verified that the 5V supply is getting to the Servo. I have also tried another Servo and another FEZ Mini.

Also for good measure I tried a level shifter to increase the PWM signal from 3.3V to 5V. Still no joy.

I am out of ideas, can anyone who has had sucess in this area give me a few pointers, thanks.

What kind of Servos are you using. The most common ones like parallax servos requires 6V

I got it working!

I had two issues:

  1. I had a bad supply connection to the servo. I had a bad solder joint that looked I OK…
  2. My 1A 5V power supply was insuffiecent to drive my large Servo, once I fixed the solder joint I could hear the Servo making noises but no movement. I connect the Servo to a 4.5 battery pack and it sprung into life.

Cool I am happy.

You need at least another thread.sleep in there too, otherwise you may as well drop off the “180” degree setting because your code will bounce straight back to 0 degrees.

So you have two power supplies? Can you confirm you have GNDs hooked together so that you don’t have two different “ground reference” voltages?

Edit: I see you sorted it. Nice one.

Excuse me, I’m using FEZ Panda II and now I was problem, please everyone tell me.
I’m following this solution

*** my problem is cannot start debugging code C# in FEZ Panda II, Moreover LED status is not flashing when debug.

Help me pls, thank you

Hi Pattharapong S, welcome to the forum.
You should start your own thread as this is now “archive” and 2 years old.

I follow 1st topic and start debugging completed, However 2 weeks later I cannot start debug. I don’t know about this problem. Can you told me for fix that?

start your own thread on the forum.