Encoder Front Page
SRS Home | Front Page | Monthly Issue | Index
Google
Search WWW Search seattlerobotics.org

Controlling Servomotors using the 80C196KC MCU

By Chae-Won Lee (ichijo@hananet.net )

[Editors Note: Chae-Won, an SRS member from South Korea, kindly contributed this article showing us how to run servo motors using the 80C196 processor. The 80C196 is an interesting chip that is worth looking at. I helped out by editing this article. Hopefully I did not introduce any errors.]

80C196KC is the most famous and wide-spread MCU family especially in South Korea because of its high performance and flexibility. Now, I'm going to introduce you a common way of controlling HS-303 and PS-348 RC Servomotors by 80C196KC MCU which is developed by INTEL.

pic1.gif (11434 bytes)

As you can see in above figure, there are four individual HSO pins in 80C196KC and each of them can easily be controlled by modifying the CAM. 

Though we need to generate a periodic signal to the control pin of servomotor, the implemented PWM pins of 80C196KC can not be adapted since their generating frequency is fixed to 39.06 25KHz or 19.53125KHz in 20MHz external OSC mode.

pic2.gif (3269 bytes)

I set P as 5ms to make use of HS-303 servomotor. The position of HS-303 with regard to P_on is as follows.

pic3-1.gif (7569 bytes)

pic4-1.gif (24737 bytes)

<Program source #1-1 : HS303_1.C : Control by external Up/Down S/W>

<Program source #2-1 : HS303_2.C : Control by external Potentiomter>

I set P as 5ms to make use of PS-348 servomotor. The position of PS-348 with regard to P_on is as follows.

pic4-2.gif (25454 bytes)

<Program source #1-2 : PS348_1.C : Control by external Up/Down S/W>

<Program source #2-2 : PS348_2.C : Control by external Potentiomter>

cf:

  1. The software I used here is INTEL iC-96 ver 2.3
  2. All sources shown here is designed for downloading onto RAM area of the 196KC system. So, there are no H/W initialization routines at all.

If you want additional information on this article, please don't hesitate to contact me via E-mail address(ichijo@hananet.net   or ichijo99@hanmail.net ).