Connect Servo HCS08

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Connect Servo HCS08

1,331 Views
MOSREJLS
Contributor I
How do I connect a servo to the HCS08 microcontroller? I have to make the servo move using the POT but I can't even get started because I don't know how to physsically connect it
Labels (1)
Tags (1)
0 Kudos
Reply
2 Replies

565 Views
pgo
Senior Contributor V

Dear MOSREJLS,

 

Questions a bit vague!

 

Do you mean a RC model servo or a DC motor that you wish to use as a servo?

 

If you mean a RC servo then the servo pin may be driven directly from the PWM (pulse-width-modulated) output of a micro if it is operating at 5V.  A 3V micro may require a level shifter to 5V (a single transistor hopefully).

The main problem is software - programming the PWM to produce a 20ms period waveform with a high-time of between 1 to 2 ms (from memory).  Do a search on the web for a description of how RC servos work. 

 

If you mean a DC-motor then its much more complicated and well beyond what could be described here.

 

bye

565 Views
Vasilakes
Contributor II

thats more of a hardware question than a compiler question...

But basically you need to connect a MOSFET or transistor to a pin on the MCU, and drive the MCU's pin with a pulsewidth modulator to controll the speed of the motor.

 

Now if you want the motor to run in both directions you need to use more transistors ( or MOSFETS) in an H bridge configuration and 1 or 2 more I/O  pins to select the direction of said H Bridge and the PWM pin is used to determine the speed of the motor in the selected direction.