Searching \ for '[PIC:] Scanning many keys with one input' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ios.htm?key=input
Search entire site for: 'Scanning many keys with one input'.

Exact match. Not showing close matches.
PICList Thread
'[PIC:] Scanning many keys with one input'
2004\01\07@181915 by Rob Stockley

flavicon
face
Would someone refer me to a working example of tip #5 "Scanning many
keys with one input" from "12f6xx - Tips and Tricks" from MicroChip. A
link to the pdf is at the end of this message. Here is the complete text
of that tip.

========
TIP #5 Scanning Many Keys With One Input

The time required to charge a capacitor depends on resistance between
VDD and capacitor. When a button is pressed, VDD is supplied to a
different point in the resistor ladder. The resistance between VDD and
the capacitor is reduced, which reduces the charge time of the
capacitor. A timer is used with a comparator or changing digital input
to measure the capacitor charge time. The charge time is used to
determine which button is pressed.

Software sequence:

1.  Configure GP2 to output a low voltage to discharge the capacitor
through I/O resistor.
2.  Configure GP2 as one comparator input and CVRef as the other.
3.  Use a timer to measure when the comparator trips. If the time
measured is greater than the maximum allowed time, then repeat;
otherwise determine which button is pressed.
========

There is a schematic diagram in the pdf

Thanks,
Rob

Link to pdf version
http://www.microchip.com/download/lit/pline/picmicro/families/12f6xx/40040b.pdf

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\01\07@190733 by Jinx

face picon face
> Would someone refer me to a working example

This basically does the same thing

http://home.clear.net.nz/pages/joecolquitt/0pots.html

measure  btfsc  pot        ;bump measure while pot pin is low
        goto   store      ;else jump out and store count
        incf   count1
        goto   measure

In your case, pressing a button is moving Vcc rather than in
my example, which moves the wiper, but to the cap it looks
just the same

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

More... (looser matching)
- Last day of these posts
- In 2004 , 2005 only
- Today
- New search...