Demultiplexer/Decoder question

Hey all--

I know more about software than hardware, but I'm designing a demonstration application for the JStamp, an embedded java processor. The application is a quad servo controller. (I'm referring to the hobby servo's that are used in robotics and modeling.) The JStamp has two dedicated circuits for generating PWM signals continually varying duty cycles.

My plan is to use one of these to drive 4 servos (and theoretically more than that) at once. Each servo requires a +5V pulse train with a 20 ms period and a duty cycle ranging from 5-10%. Therefore, I figure I can output 4 pulses every 20 ms instead of just one, and simply direct one of each of the pulses to each of the 4 servos in turn.

Now like I said, I'm not an EE, so I don't know exactly how to do this. My sense is that I need a demultiplexer. I looked at the data sheet for one that is stocked in my school's lab, and it seems to do what I want, except that it uses active low outputs. So I suppose I would need to use an inverter to get my signal flipped back around the way I need it. Are there demultiplexer chips which preserve the polarity of the original signal? Fewer ICs is better, I wanted to build this on a real small protoboard.

Also, the other issue is how to select an output line from the 4 available on the demux. I could use two output pins from the JStamp to select this line manually, but doing this in software seems cumbersome. I think a cleaner idea would be to use the PWM output to drive a counter. On each negative edge, the counter would increment, and the counter's output would be configured as the address select for the demux. The counter would reset when it got to 4. Is this a clean way to do this?

I'm trying to take propagation times into account to decide if I'm making a blunder here. The demux I'm looking at (an LS155, btw) propagates signals in anywhere from 30-50 ns...definitely fast enough. But I'm worried that if I have to wire up an inverter on my breadboard, that is going to slow things down into the range of a few microseconds, and I'm don't have the experience to know if that is too much delay.

--
|\/|  /|  |2  |<
mehaase(at)sas(dot)upenn(dot)edu
Reply to
Mark Haase
Loading thread data ...

--
From your explanation of the 5% duty cycle servo pulse it seems it
should look something like this:


   -->| ||  |-------|A1     |
A0>-------|A0     |
          |       |
PWM-------|E3   Y3|---->CH4
       +-O|E2-  Y2|---->CH3
       |  |     Y1|---->CH2
       +-O|E1-  Y0|---->CH1
       |  +-------+
      GND
Reply to
John Fields

You may not want to use the high output of the circuit to drive the servos, your output device may not be able to provide the current your servos want without loading the output signal.

Active low is there for a reason, to let the output device sink instead of source. Connect the voltage source to your servo, then let the output device go low to start motion.

--
Fins
Reply to
DM

--
There are two problems there, as I see it.  The first is that you've
got to use an extra chip, and the second is that if the counter ever
gets out of sync you'd be in real trouble, with no way to get back in
sync if the servos are running .

If the thing is going to run continuously, ISTM that all you have to
do is increment a register in the micro, (once for each loop) then
output the two LSBs to use to drive the muxer's address lines and then
the PWM signal which corresponds to that count.
Reply to
John Fields

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.