To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.handyboardOpen lugnet.robotics.handyboard in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / Handy Board / 217
216  |  218
Subject: 
How to run 8 servos by adding one HC chip
Newsgroups: 
lugnet.robotics.handyboard
Date: 
Tue, 26 Mar 1996 02:48:00 GMT
Original-From: 
Randy Sargent <rsargent@kipr.orgSPAMCAKE>
Viewed: 
1683 times
  
(If you're
running multiple servos, I think I know a single-chip hardware mod to drive
up to 8 servos from a single timer output.)

-- Randy

I'm doing signal conditioning for pan/tilt and (ultimately) drive/steer
signals from an RC receiver and driving servos with the processed
signals.  All power for the servos is external, so all I need is signals
through the Handyboard.

-mike

--------
What is it?
Chris Tant

Warning:  I haven't tried the following idea.

Single chip add-on to control 8 servos using one timer line and a few
digital outputs:

The 74HC238 is a 3 to 8 demultiplexor.  (see
http://www.st.com/STonLINE/books/all/1926.html for datasheets).  Unlike the
more common HC138, its outputs are active high.  It also appears to be
harder to find (I found it in the JDR Microdevices catalog, 1-800-538-5000,
but not glancing through Jameco or Digikey).

Since servo pulses are quite short (typically .5 - 2ms), and their period
is large in comparison (20ms), you can have a single timer line time-slice
between the different servos you're running.  Simply run a timer line into
one of the enables of the HC238, run 3 digital outputs from the 6811 (such
as the Port D lines) to the three HC238's select lines, and run the 8
output lines to up to 8 servos.  Set the timer line to toggle on output
compare, and use the following algorithm in your interrupt handler:

timer_interrupt_handler:
  if last edge was rising then
    reschedule compare for t_old+width[current_servo]
    return

  if last edge was falling then
    reschedule compare for t_old+2.5ms-width[current_servo]
    current_servo++
    if (current_servo > 7) current_servo= 0
    output current_servo # to select lines (port D)

If you only want 4 servos, you can just use two port D lines.

(Also, I think there is a chip, maybe the HC237?, which latches the select
lines.  You can put this chip on a bus, if you have an extra chip select,
and not sacrifice any port D lines.  Maybe someone could do this on an
expansion board).

-- Randy



1 Message in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR