[TriEmbed] TriEmbed Digest, Vol 11, Issue 12

Martin Brooke martin.brooke at duke.edu
Thu Apr 10 18:08:42 CDT 2014


Is there some reason you cannot do this in software?

The MCU knows it got an input from the pin, why does it need to check if it
is still high?

If you need the voltage on the pin for something else, just immediately
drive the pin after you read it using a resistor to protect the output from
driving the switch while it is still on (although many chips can take that
abuse).

You have millions of transistors on the MCU you shouldn't need any more :-)






On Thu, Apr 10, 2014 at 11:38 AM, <triembed-request at triembed.org> wrote:

> Send TriEmbed mailing list submissions to
>         triembed at triembed.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://mail.triembed.org/mailman/listinfo/triembed_triembed.org
> or, via email, send a message with subject or body 'help' to
>         triembed-request at triembed.org
>
> You can reach the person managing the list at
>         triembed-owner at triembed.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of TriEmbed digest..."
>
> Today's Topics:
>
>    1. "Latching" device (Grawburg)
>    2. Re: "Latching" device (Glen Smith)
>    3. Re: "Latching" device (Bill Farrow)
>    4. Re: "Latching" device (Carl Nobile)
>    5. Re: "Latching" device (Pete Soper)
>
>
> ---------- Forwarded message ----------
> From: Grawburg <grawburg at myglnc.com>
> To: Triangle Embedded Devices <TriEmbed at triembed.org>
> Cc:
> Date: Thu, 10 Apr 2014 08:55:28 -0400
> Subject: [TriEmbed] "Latching" device
> I'm making a traffic light project for the Raspberry Pi using an MCP23017
> port expander. The Python code works fine and lights up the
> 6 LEDs in the correct pattern. Now I want to add some other features and
> need a way to "latch" a device that is connected to one of the
> input pins on the MCP when I press a push button. It needs to remain high
> until specifically set low by a Python command. Perhaps there is
> some type of solid state device (3.3 VDC) that will function in this
> manner.
>
>
> Brian Grawburg
> Wilson
>
> --
> I use Opera Web Browser.
>
>
>
>
>
>
>
>
> ---------- Forwarded message ----------
> From: Glen Smith <mrglenasmith at gmail.com>
> To: Grawburg <grawburg at myglnc.com>
> Cc: Triangle Embedded Devices <TriEmbed at triembed.org>
> Date: Thu, 10 Apr 2014 09:20:00 -0400
> Subject: Re: [TriEmbed] "Latching" device
> A set reset latch will do just what you are asking for. You can build your
> own with cross coupled Nand gates or you can plop down a ready made one.
> The 74LV00 is a 3.3v quad Nand in a 14 pin DIP. With this you can make 2
> S-R latch's.
>
> Digikey has the  74LVC574 available for $0.59 each in 20 pin DIP which
> gets you 8 of them in a pack.
> http://www.digikey.com/product-detail/en/SN74LVC574AN/296-12910-5-ND/476078
>
> Glen
>
>
> On Thu, Apr 10, 2014 at 8:55 AM, Grawburg <grawburg at myglnc.com> wrote:
>
>> I'm making a traffic light project for the Raspberry Pi using an MCP23017
>> port expander. The Python code works fine and lights up the
>> 6 LEDs in the correct pattern. Now I want to add some other features and
>> need a way to "latch" a device that is connected to one of the
>> input pins on the MCP when I press a push button. It needs to remain high
>> until specifically set low by a Python command. Perhaps there is
>> some type of solid state device (3.3 VDC) that will function in this
>> manner.
>>
>>
>> Brian Grawburg
>> Wilson
>>
>> --
>> I use Opera Web Browser.
>>
>>
>>
>>
>>
>> _______________________________________________
>> Triangle, NC Embedded Computing mailing list
>> TriEmbed at triembed.org
>> http://mail.triembed.org/mailman/listinfo/triembed_triembed.org
>> TriEmbed web site: http://TriEmbed.org
>>
>
>
>
> ---------- Forwarded message ----------
> From: Bill Farrow <bill at arrowsreach.com>
> To: Triangle Embedded Devices <TriEmbed at triembed.org>
> Cc:
> Date: Thu, 10 Apr 2014 09:31:23 -0400
> Subject: Re: [TriEmbed] "Latching" device
> I was wondering if there is a "tricky" way you could do this using
> only a single pin, a capacitor, and a resistor.
>
> When the push button connects it charges the capacitor. The MCU pin,
> configured as an input, can read the state of the capacitor. When the
> MCU wants to reset the latch it can change the pin to an output and
> set it to 0 (low) which discharges the capacitor to ground via the
> resistor.
>
> Let's see how bad my ascii art is:
>
> mcu pin --- resistor --- switch --- 3.3v
>                              |
>                        capacitor
>                              |
>                            GND
>
> Bill
>
>
>
>
> ---------- Forwarded message ----------
> From: Carl Nobile <carl.nobile at gmail.com>
> To: Bill Farrow <bill at arrowsreach.com>
> Cc: Triangle Embedded Devices <TriEmbed at triembed.org>
> Date: Thu, 10 Apr 2014 10:31:29 -0400
> Subject: Re: [TriEmbed] "Latching" device
> Something to be aware of is that the MCP23017 is a 5V device not a 3.3V
> device. It seems to work without a level converter, but could fail on some
> occasions like when adding more than one load to the output pins of the
> RPi, so it's best practice to always use a level converter between the RPi
> and a MCP23017.
>
> Carl
>
>
>
> On Thu, Apr 10, 2014 at 9:31 AM, Bill Farrow <bill at arrowsreach.com> wrote:
>
>> I was wondering if there is a "tricky" way you could do this using
>> only a single pin, a capacitor, and a resistor.
>>
>> When the push button connects it charges the capacitor. The MCU pin,
>> configured as an input, can read the state of the capacitor. When the
>> MCU wants to reset the latch it can change the pin to an output and
>> set it to 0 (low) which discharges the capacitor to ground via the
>> resistor.
>>
>> Let's see how bad my ascii art is:
>>
>> mcu pin --- resistor --- switch --- 3.3v
>>                              |
>>                        capacitor
>>                              |
>>                            GND
>>
>> Bill
>>
>> _______________________________________________
>> Triangle, NC Embedded Computing mailing list
>> TriEmbed at triembed.org
>> http://mail.triembed.org/mailman/listinfo/triembed_triembed.org
>> TriEmbed web site: http://TriEmbed.org
>>
>
>
>
> --
>
> -------------------------------------------------------------------------------
> Carl J. Nobile (Software Engineer)
> carl.nobile at gmail.com
> -------------------------------------------------------------------------------
>
>
>
> ---------- Forwarded message ----------
> From: Pete Soper <pete at soper.us>
> To: triembed at triembed.org
> Cc:
> Date: Thu, 10 Apr 2014 11:38:29 -0400
> Subject: Re: [TriEmbed] "Latching" device
>  In my browser the vertical bar from the cap is further to the right than
> you intended, but I think we get it.
>
> So the capacitor will be discharged by the mcu pin's input resistance in
> series with the resistor. I agree this should work wonderfully as long as
> the cap is made large enough to keep the voltage high "long enough." If the
> latching action is only needed for a minute or two then a conventional cap
> may work well. For a longer time a supercap might be required.  The MCU (or
> expander port chip) data sheet and the resistor value could be used to
> calculate the time constant. But that's for a perfect cap: the super caps
> will approach this, but regular electrolytics will discharge faster where
> the other resistance involved is very large.
>
> A key issue is whether the resistor helps or hurts. If the latch needs to
> stay valid for a couple days, for instance, then when the pin is set to
> output and driven to ground it could take a very long time to discharge the
> capacitor. The software also has to keep track of that discharge time,
> re-testing the pin to confirm it's discharged or ignoring the pin "long
> enough" to avoid being tricked by another button press happening too soon
> after the earlier one.
>
> So the size of the capacitor in relation to how long the "latching" must
> last as well as how fast the discharge has to go would allow judging
> whether this circuit would meet Brian's requirements.  But it surely wins
> the simplicity award!
>
> If two pins could be used a classic SR latch should work. This would be a
> pair of gates (such as two CMOS nor gates) where the pushbutton applies a
> potential to the "set" input and the mcu pin senses Q or Q bar and applies
> a potential to the "reset" input. Here's a description<http://en.wikipedia.org/wiki/Latch_%28electronics%29#SR_NOR_latch>
> .
>
>
> -Pete
>
> On 04/10/2014 09:31 AM, Bill Farrow wrote:
>
> I was wondering if there is a "tricky" way you could do this using
> only a single pin, a capacitor, and a resistor.
>
> When the push button connects it charges the capacitor. The MCU pin,
> configured as an input, can read the state of the capacitor. When the
> MCU wants to reset the latch it can change the pin to an output and
> set it to 0 (low) which discharges the capacitor to ground via the
> resistor.
>
> Let's see how bad my ascii art is:
>
> mcu pin --- resistor --- switch --- 3.3v
>                              |
>                        capacitor
>                              |
>                            GND
>
> Bill
>
> _______________________________________________
> Triangle, NC Embedded Computing mailing listTriEmbed at triembed.orghttp://mail.triembed.org/mailman/listinfo/triembed_triembed.org
> TriEmbed web site: http://TriEmbed.org
>
>
>
> _______________________________________________
> TriEmbed mailing list
> TriEmbed at triembed.org
> http://mail.triembed.org/mailman/listinfo/triembed_triembed.org
>
>


-- 

Martin Brooke

-- 
 *Martin Brooke*
Associate Professor,
and Philip Baugh Scholar
Department of Electrical and Computer Engineering <http://www.ee.duke.edu>
Box 90291
Duke University <http://www.duke.edu/>
Durham, NC 27708-0291

*Phone:* (919) 660-5504
*Secretary:*  (919)-660-5252
*Fax:*   (919)-660-5293
*E-Mail:* mbrooke at ee.duke.edu


*Office:*

3581 FCIEMAS Building
3rd Floor South Wing
Duke University
Durham, NC 27708





*Physical Delivery Address:*

Department of Electrical and Computer Engineering
130 Hudson Hall
Duke University
Durham, NC 27708
Phone: (919)-660-5252

[Home] <http://www.ee.duke.edu/%7Embrooke/index.html>[Academic<http://www.ee.duke.edu/%7Embrooke/00courses.html>
] [Research] <http://www.ee.duke.edu/%7Embrooke/00research.html>[
Publications <http://www.ee.duke.edu/%7Embrooke/Papers.html>]
[More...]<http://www.ee.duke.edu/%7Embrooke/my_index.html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.triembed.org/pipermail/triembed_triembed.org/attachments/20140410/ddc7e649/attachment.htm>


More information about the TriEmbed mailing list