Hi all, i had a similar problem long ago..... Firstly, YES, keep that pot value down to under 40K......your 1Meg is way too high, and is succeptable to 'noise'.... You may still find a 10-20k pot doesnt cure your 'jitter' problem, and i think maybe you chose a larger value (1meg) pot, becuase you were thinking you'd have more precise control changing between numbers??? (so did i) Anyway, my cure was to alter my code a little, instead of reading/looking up only 16 codes(bytes), i actually assigned 4 codes per pot 'position'. For example, when the pot is at minimum, i had 4 bytes assigned as "00"......then the next 4 bytes set at "01", and next 4 bytes set at "02" all the way upto "0F" (pot maximum). This meant that is the pot value varied slightly, it would still be within my 4 byte 'window' (or "deadzone" if you prefer).... You may also want to increase the assgined bytes to "8 bytes, per pot value" (or more) which will further reduce any chance of jitter. You will also notice that you have also extended the 'physical' range of your pot rotation, so in fact you need to turn the pot 2-3mm travel before the next digit changes over, rather than turning your pot only 5mm and seeing all 16 digits flicker thru, making it hard to lock onto the actual digit you require. (many people had resorted to using 10turn pots to achive some form of control) Failing all the above, use a 2bit (2 phase output) rotary encoder ;-) Regards, Marty (yeh i'm new here) ----- Original Message ----- From: To: Sent: Sunday, July 27, 2003 11:33 AM Subject: [PIC]: ADC, Pot, need help > 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. > > -- > http://www.piclist.com hint: PICList Posts must start with ONE topic: > [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.504 / Virus Database: 302 - Release Date: 7/24/03 -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads