Connect Servo HCS08

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Connect Servo HCS08

1,707件の閲覧回数
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
ラベル(1)
タグ(1)
0 件の賞賛
返信
2 返答(返信)

941件の閲覧回数
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

941件の閲覧回数
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.