On Sun, Sep 13, 2015 at 09:06:41PM -0400, Vartan Haghverdi wrote: > Isaac how does that work? Would the uC switch between each extended pin > many times per second? I'm not exactly sure of the "clever trick". I suspect it involves using a diode, cap, and pullup resistor to trigger the latch using the clock pin. The basic operation of the part couples an 8 bit flip flop with a 8 bit serial shift register. When you want to read 8 inputs, you clock the flip flop to store the current state of the inputs. You then clock them in 1 bit at a time using the serial shift register. The shift register only needs two pins: clock and data. In addition multiple parts can be strung together. So even if you needed 24,32, or 64 inputs, it would still only need two pins to read them all in after they have been latched. BAJ > On Sep 13, 2015 8:24 PM, "Isaac Marino Bavaresco" < > isaacbavaresco@yahoo.com.br> wrote: >=20 > > The OP could use the 74HC597 to serially expand the number of inputs. > > Usually it would need three I/O pins, but with a clever trick it is > > possible to use just two. > > It is possible to expand the input pins to virtually any number, in > > multiples of eight. > > > > Isaac > > > > > > Em 13/09/2015 20:13, IVP escreveu: > > >>> Thanks. I am only looking for 5 bit accuracy. > > >>> > > >> That might be asking a bit much - not from the PIC, that's easy > > >> enough - from the person. > > >> 5 bits =3D 32 position values. Typical pot has about 270 degrees > > >> of travel. 270 / 32 =3D ~8.4 degrees. > > > My nephew has a guitar effects box, and one of the selectors > > > looks rather like that on a DMM, but is actually a pot with 10 > > > detent positions between fully CCW and fully CW, giving 12 > > > distinct settings altogether. The knob is spring-loaded against > > > a ring of bumps in the case plastic > > > > > > Maybe you can make something with a slotted disc and a ball > > > bearing and a spring or other bits and pieces. 32 values is going > > > to be tricky though. > > > > > > 10-turn pot ? With vernier ? > > > > > > Analogue TVs had slide pots with a screw thread for tuning > > > > > > Two thumbwheel or BCD switches, 10s and 1s ? > > > > > > How about an optical encoder, bought or made. You could > > > print a scale on a transparency. Perhaps 5 rings to represent > > > 5 bits in a simple binary code, or 1 ring of stripes to generate > > > pulses to count > > > > > > There are many variations of digital calipers, protractors and > > > rulers you could take apart for a very fine position sensor > > > > > > Pehaps hack an optical mouse. Draw a circle on the screen > > > now with it. Can you potentiometerise that ? > > > > > > All options have drawbacks - accuracy, precision, consumption, > > > reset on power-down, cost, fiddliness etc > > > > > > Joe > > > > > > > > > ----- > > > No virus found in this message. > > > Checked by AVG - www.avg.com > > > Version: 2015.0.6125 / Virus Database: 4419/10635 - Release Date: > > 09/13/15 > > > > > > > > > > > -- > > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive > > View/change your membership options at > > http://mailman.mit.edu/mailman/listinfo/piclist > > > --=20 > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist --=20 Byron A. Jeff Associate Professor: Department of Computer Science and Information Technol= ogy College of Information and Mathematical Sciences Clayton State University http://faculty.clayton.edu/bjeff --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .