go_away

Author Topic: Servo ports  (Read 2457 times)

0 Members and 1 Guest are viewing this topic.

Offline RadikenTopic starter

  • Jr. Member
  • **
  • Posts: 39
  • Helpful? 0
Servo ports
« on: May 19, 2007, 08:50:35 PM »
Do Servos/motors need to be plugged into a PWM port, or will a standard digital output port work.

I've read that they should be plugged into PWM ports, but do they still work with the digital output?
The best way to get to the top is to get off your bottom.

Offline ed1380

  • Supreme Robot
  • *****
  • Posts: 1,478
  • Helpful? 3
Re: Servo ports
« Reply #1 on: May 19, 2007, 09:29:36 PM »
motors into pwm outputs and servos into digital. don't forget when using motors, h-bridge or motor drivers are needed, so you might need digital. it depends on the driver/h-bridge.

<-----NOOB
Problems making the $50 robot circuit board?
click here. http://www.societyofrobots.com/robotforum/index.php?topic=3292.msg25198#msg25198

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: Servo ports
« Reply #2 on: May 19, 2007, 09:42:40 PM »
Which microcontroller?

PWM ports have the advantage that you can tell it to do something in software and then forget about it. With digital ports, you must call them every 100ms or so to run a servo.

The problem with PWM ports is that there are not very many on a microcontroller, often between 1 and 4. So this is why I always use digital outputs . . . the $50 robot only uses digital output . . .

Offline RadikenTopic starter

  • Jr. Member
  • **
  • Posts: 39
  • Helpful? 0
Re: Servo ports
« Reply #3 on: May 19, 2007, 09:48:11 PM »
I'm putting my skills to the test by designing my first board from scratch using the PIC16F877.
I was curious on whether to set up the plugs for servos to connect to digital I/O ports or the PWM ports.

Looking at the datasheet, I can't tell whether the PIC16F877 has 2 or 4 PWMs...
The best way to get to the top is to get off your bottom.

Offline JonHylands

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 562
  • Helpful? 3
  • Robot Builder/ Software Developer
Re: Servo ports
« Reply #4 on: May 20, 2007, 05:44:50 AM »
The 16F877 has two, and they aren't really all that great for driving a servo, but you could do it.

Its easy enough to set up a timer interrupt to handle processing up to 8 or 9 servos on the 877 in the background, assuming you're running at a decent clock speed (8 MHz or more).

- Jon

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: Servo ports
« Reply #5 on: May 20, 2007, 10:49:15 AM »
Quote
Its easy enough to set up a timer interrupt to handle processing up to 8 or 9 servos on the 877 in the background, assuming you're running at a decent clock speed (8 MHz or more).

I did this method for my Fuzzy robot. Download the source code here:
http://www.societyofrobots.com/downloads/fuzzy_C_source_code.zip

 


Get Your Ad Here

data_list