Few thoughts... - If you have the PIC set for pot use and connect the encoder instead,=20 you may have a situation where you're forcing an encoder output to high=20 and perhaps cause a short. - Doesn't the encoder need pull-up resistors, and if so, does the analog=20 input you're using also have internal weak pull-ups? - If you have spare pins, perhaps send the encoder outputs to two=20 separate pins for simplicity? - A high output doesn't go all the way to Vdd, so your A/D conversion=20 may not reach full scale if you're using the internal (Vdd) reference. =20 You can compensate for that in code. Cheers, -Neil. On 3/18/2017 11:24 AM, Josh Koffman wrote: > Hi all, > > I've got to say, I'm having a lot of fun on this little dimmer project > of mine. Trying to cram as many options and possibilities into a tiny > space is intriguing! > > My latest idea involves the control. I had originally planned on using > a pot to control the dimmer. But with a bit of searching I've found a > pot and an encoder with similar enough footprints that with a bit of > tweaking I'd be able to fit either on the board. For those curious, > the pot is the P0915N-FC15BR10K and the encoder is the EN11-HSM1BF20 , > both from TT Electronics. > > My original plan was to use a bunch of resistors as jumpers and load > the board depending on which controller was installed. Then I got to > thinking...(uh oh...). > > Each device has three pins. On the pot, 1 and 3 are the sides of the > resistor, and 2 is the wiper. On the encoder, pins 1 and two are the > outputs, and 2 is the common. What I'm thinking about doing is > connecting all three to the PIC, with pin 2 being an analog input > capable pin. For pot use, I'd set pin 1 and 3 as outputs, and set 1 > high, and pin 2 as an analog input. For encoder use, I'd set pin 2 as > an output and set it low. Then set pins 1 and 3 as inputs with weak > pull ups and read away. > > Thoughts? Pitfalls? Trying for the lowest parts design to save space! > > Josh > > > > --=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 .