At 09:33 PM 7/26/2003 -0400, you wrote: >Here's the setup: PIC16F872's ADC pin, PORTA pin 0, connected to a 1 Meg >Ohm pot. Four LEDs provide output. > >Here's the requirement: use the pot to select one of 16 values, 0 to 15 >with the output being the 4 leds...a 4 digit binary number. All i do is >shift the 8 most significant bits (from the ADRESH, left aligned so 8 most >sig are in adresh with the two least sig in ADRESL) right four times so i >keep the four most significant digits which i directly output to the LEDs. > >Here's the problem: when the pot is directly between two numbers, and left >untouched, the pic will flicker between the two values because the pot i >suppose doesn't give a steady output. This isn't allowed. I've tried >adding a "debounce" where i wait to see if a value is held for 10 or 20 >times before switching the display, but all it seems to do is slow the >flicker down. Any experience or suggestions? Thanks everyone... you have >no idea how much this community has helped me. Switch the pot for a lower value one (40K maximum, so maybe a 20K pot). 10K is the maximum input impedance. Best regards, Spehro Pefhany --"it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads