Shop OBEX P1 Docs P2 Docs Learn Events
(more or less) Universal input circuits — Parallax Forums

(more or less) Universal input circuits

bte2bte2 Posts: 154
edited 2015-01-13 01:02 in Propeller 1
Hi everyone! I've been laying out boards since the days of vellum and technical pens, and over the years I have assembled a library of circuits that I use to do different things.

I'm doing a board now that got my curiosity roused, and I thought I would pitch it out and see what comes back.

What I am looking for is people's ideas regarding a Universal input circuit to a propeller pin, that can be used to read an unknown (at design time) signal. Something that can read a toggle switch (if that is what is connected), or an analog (of unknown origin), or a pulse counter, or a serial data stream(since we're feeling ambitious, with RS-232 levels). 4-20mA. Zero crossings(off of a transformer, of course).

I'm looking to build the most versatile input circuit I can. I have one circuit that does most of what I am looking for, but it takes up too much real estate on the board. It is an op-amp circuit that, depending on how I populate the jumpers and resistors, will read any sensor I can connect to it and protect the Prop pin in the process.

I like what I have now, but I am just wondering out loud what other folks are doing; maybe see if there are any new parts I have missed.

If anybody wants, I will budge up a schematic of my circuit and post it, but it is hard to describe how to set the parts. As long as I know going in what will be connected, it works great.

Comments

  • Heater.Heater. Posts: 21,230
    edited 2015-01-12 13:22
    bte2,

    "Universal input" is a tall order.

    A high impedance input or low? Analogue or digital? High frequency or low? Current driven or voltage driven? Differential or single ended? Pull high or pull low? Heck, high voltage or low? Does it need protection?

    I think you have to determine your goal here and specify accordingly.
  • PublisonPublison Posts: 12,366
    edited 2015-01-12 13:42
    Take a look at Jon Mac's articles:

    http://www.parallax.com/downloads/propeller-spin-zone-articles-and-code

    They include the standard, (at the time), Propeller Development Platform. It could be built upon using stack up boards.

    The board layout are all available using ExpressPCB free software:

    http://www.expresspcb.com/
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2015-01-12 14:17
    The standard sigma-delta input structure with feedback should be able to accommodate a wide common-mode range, be able to do ADC and, with an input load resistor 4-20mA. No op-amp necessary!

    -Phil
  • jmgjmg Posts: 15,173
    edited 2015-01-12 15:52
    bte2 wrote: »
    What I am looking for is people's ideas regarding a Universal input circuit to a propeller pin, that can be used to read an unknown (at design time) signal. Something that can read a toggle switch (if that is what is connected), or an analog (of unknown origin), or a pulse counter, or a serial data stream(since we're feeling ambitious, with RS-232 levels). 4-20mA. Zero crossings(off of a transformer, of course).

    I'm looking to build the most versatile input circuit I can. I have one circuit that does most of what I am looking for, but it takes up too much real estate on the board. It is an op-amp circuit that, depending on how I populate the jumpers and resistors, will read any sensor I can connect to it and protect the Prop pin in the process.
    That's quite a shopping list of features, and if you are prepared to populate jumpers and resistors it can be made flexible.
    However, a more desirable Universal input circuit, would not need "populate the jumpers and resistors"

    A standard ADC needs 2 pins, but can be configured to have a nominal ~Vcc/2 or ~0V mid-point.
    That places a CAP at the Prop pin, which is not so good when you want Pulse or RS232 streams, so it needs a jumper.

    The simplest jumper-set circuit I can envision, would have a jumper for the CAP, a jumper for Offset, and a Jumper for load resistor. Highest speed pulse use would add a parallel (some pF) peaking cap to the series Pin resistor.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2015-01-12 16:38
    jmg wrote:
    That places a CAP at the Prop pin, which is not so good when you want Pulse or RS232 streams, so it needs a jumper.
    I used to think that, too, but it's less of a problem than one might think. With feedback keeping the input node at Vdd/2, the voltage on the cap stays virtually constant, so it doesn't really slow down the input response much.

    -Phil
  • jmgjmg Posts: 15,173
    edited 2015-01-12 16:59
    I used to think that, too, but it's less of a problem than one might think. With feedback keeping the input node at Vdd/2, the voltage on the cap stays virtually constant, so it doesn't really slow down the input response much.
    - but that forces the pin to always be run in feedback mode, ( and assumes IP is within range) which is not always desirable/true.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2015-01-12 17:33
    That's true but only an issue if the inputs exceed the common-mode range imposed by the resistors. I guess it has to be choice, then, of multiple resistor choices or a jumper for the cap. ... or maybe a third, DUTY-mode pin and another resistor to programmably bias the input node back into range?

    -Phil
  • jmgjmg Posts: 15,173
    edited 2015-01-12 18:32
    .. ... or maybe a third, DUTY-mode pin and another resistor to programmably bias the input node back into range?

    ..or, use the 3rd Pin to switch the CAP ?
    With a [Rin // Peaking C], the CAP-removed pin can also now be used as an output, to drive light Logic loads, and with some 'slip' protection.
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2015-01-12 22:38
    I've tried my hand at some general purpose i/o, always with an external ADC, not an internal sigma-delta. The ADC is usually 16 bits with several levels of gain programmable over the system I2C buss. To mux the ADC with digital signals, I've taken a liking to the TXS0101, which is an I2C buss isolator, bidirectional. One nice feature is that its chip enable pin tri-states both sides of the chip. Not only does it provides a degree of protection to the Prop, but it allows the digital i/o buss to be isolated from the inputs so that they can feed the ADC unperturbed. In active mode, the isolator enables pullup resistors that are good for switches as well as for digital control outputs and in pairs for external I2C and, with care, other digital protocols. Counting, signal generation. A fet controls a termination resistor for the 4-20 loop input to the ADC. Having the i/o in pairs and an ADC capable of low level differential inputs enables bridge instrumentation. The plethora of options does eat up pins, or requires an external I2C digital mux. It ends up with a big area of external components. Going general purpose always involves compromises, but it sure is convenient at times. Of course, an advanced PIC chip might offer a plethora of multiplexing options without any external components... but that wouldn't be a prop.
  • bte2bte2 Posts: 154
    edited 2015-01-13 00:58
    Heater. wrote: »
    bte2,

    "Universal input" is a tall order.

    A high impedance input or low? Analogue or digital? High frequency or low? Current driven or voltage driven? Differential or single ended? Pull high or pull low? Heck, high voltage or low? Does it need protection?

    I think you have to determine your goal here and specify accordingly.

    Oh I know. I was about 75% tongue-in-cheek in my post. Mostly curious to see what people are doing in the way of nice, robust inputs. It would be cool to take a circuit like mine and control it with digital pots, but that might be a little more work than it's worth. And yes, looking to see if anybody had something in the way of new/better/different parts that may have gotten past me.

    Like I said, just curious. Seemed like a decent topic to throw out there.

    :-)
  • bte2bte2 Posts: 154
    edited 2015-01-13 01:02
    I've taken a liking to the TXS0101

    EXACTLY the kind of thing I was looking for. Thank you- I'll check it out :-)

    ETA- I like it and ordered some from Digikey. It has a lot of promise for doing things like running a 5v display or the driving the addressable LEDs. Thanks again!
Sign In or Register to comment.