Shop OBEX P1 Docs P2 Docs Learn Events
Having a problem diode clamping a voltage for input to a Propeller — Parallax Forums

Having a problem diode clamping a voltage for input to a Propeller

ElectricAyeElectricAye Posts: 4,561
edited 2009-03-12 22:25 in Propeller 1
Hi all,

I recently put a diode clamp into a circuit design in hopes of reducing the output of a comparator from 7 volts down to 3.3 volts, which I thought was safer for the Propeller. (See figure 1 in the attachment.) The output of the comparator should be a nearly square wave with a width of approximately 1 microsecond and an amplitude of nearly 3.3 volts. Problem is, after I joined this circuit to my Propeller with a 6 foot long coax cable (50 ohm BNC), the signal at the Propeller pin has a width of many microseconds and an amplitude of only about 1.7 volts, which is dangerously close to the Prop's detection threshold of 1.6 volts. Needless to say, at higher frequencies (circa 300kHz) this situation doesn't work so well.

After pondering this problem, I suspect that my use of R1 in the diode clamp greatly affects the impedance of the cable, and so my output pulse is getting stretched out before it gets to the Propeller. In this case R1 is 2.1 Kohms. The diode is 1N5226B.

So I have two problems I'm trying to clear up. First, I need an interim solution that allows me to use my set up as-is but with a small modification to help keep the pulses from stretching out so much. I thought about the circuit as seen in my attached figure 2, but my instincts tell me something is wrong with that. So I pondered the possibility of using another resistor, R2, closer to the Propeller pin that would help match the impedance, IF indeed that is the problem my circuit is suffering from. See figure 3.

The second problem is that my next design will put both the comparator and the Propeller on the same PCB, so there will be no coax connection. In this case, I was wondering if the design shown in figure 1 would be okay to use since (I'm hoping/guessing) any impedance mismatch issues would not be a problem then.

Of course, I suppose it's very possible that I'm wrong about all of this and I've completely screwed up my design since I don't really know what I'm doing here, hacking my way through a jungle of ignorance.

Any suggestions or observations will be greatly appreciated.
Ridicule will be accepted, too, if followed by elegant solutions to the problem.

many thanks,
Mark blush.gif

Post Edited (ElectricAye) : 3/12/2009 1:34:39 PM GMT

Comments

  • Brian FairchildBrian Fairchild Posts: 549
    edited 2009-03-12 14:28
    Depending on the exact coax you're using you've got 100-200pF of hidden capacitance there across the zener which is really going to slow down your edges. I'd not worry too much about matching your cable impedance - at the frequency you're interested the length you have is electrically short but you can play a trick. If you can guarantee the op of the comparator is never going to be much more than 7v I'd be tempted to try...

    output of comparator -> 50R series resistor -> cable -> 50R resistor to ground -> 1k series resistor -> prop input pin.

    The two resistors will match the cable and act as a potential divider. You should see around 3.5v on the far end. The 1k will work with the input zener of the prop to limit the signal to 3v3. You could add extra protection in the form of a 4v7 zener across the 50R resistor which goes to ground to stop spikes. This setup does require the comparator to have a decent current drive. What comparator are you using?

    oh, and fig 2 is bad. The volts seen by the prop will be the zener voltage plus an extra voltage generated across the resistor which will depend on the value of R and the output voltage of the comparator.
  • telluriantellurian Posts: 52
    edited 2009-03-12 14:33
    I'd just use a voltage divider and be done with it or better yet use a comparator that is single supply and will run off of 3.3V (lots of them around). The zener is probably overkill unless you have a very noisy environment with big spikes (as in orders of magnitude or more bigger than VCC, in an automobile perhaps).
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-03-12 16:43
    Comparators are typically open-drain devices, although there are exceptions. If yours is open-drain, I'd fix the problem at the source: i.e. pull the output up to 3.3V rather than 7V. This can be as simple as leaving the pullup that's there in place and adding a pulldown of the appropriate resistance to divide the 7V to 3.3V. This should be adequate to drive a short piece of coax, like the 6-footer you're using. Once you've got everything on one board, you can just use the Prop's Vdd as your pullup source, even though the comparator itself may be running on 7V.

    If your comparator is not open-drain, think about to switching to one that is.

    -Phil
  • ElectricAyeElectricAye Posts: 4,561
    edited 2009-03-12 17:07
    tellurian said...
    ...The zener is probably overkill unless you have a very noisy environment with big spikes (as in orders of magnitude or more bigger than VCC, in an automobile perhaps).

    Yes, now that I think about this, you guys are right. In another part of the circuit, I started using these diode clamps because there is a potential for large spikes, but downstream of this comparator (AD8561) the output is a known quantity, which can be cut down with a voltage divider as you suggested. I guess I just went "clamp happy" after learning how to use a diode clamp for the first time - sorta.

    I guess I violated the first rule of engineering design.... what was it? ... something about lips and low pressure osculation?

    thanks, everyone,
    Mark

    smile.gif
  • Brian FairchildBrian Fairchild Posts: 549
    edited 2009-03-12 17:43
    There's a note in the AD8561 datasheet about driving loads of more than 50pF causing ringing. You coax may have more than that.

    The good news is it'll drive 100R so my suggestion above will work. By keep resistances low any capacitive effects will be minimised.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2009-03-12 22:25
    Brian Fairchild said...
    There's a note in the AD8561 datasheet about driving loads of more than 50pF causing ringing. You coax may have more than that....

    That's a very good point, something I had overlooked (or probably didn't understand the first time I read it.). It seems like such a tiny amount of capacitance, though. It makes me wonder what else I have to worry about, like the inputs to other chips, AND gates, etc.

    thanks for pointing this out to me.

    Mark


    smile.gif
Sign In or Register to comment.