You can filter the A/D input in firmware. I use a combination of=20 averaging, and an IIR filter for this, and the amount of filtering=20 depends on how quickly I expect the input to change. Since you're using=20 a pot (assuming that's the final intent and would not be replaced by=20 some fast sensor), then you can do quite a bit of filtering. Effectively, think of it as looking at the change between the last A/D=20 value used and the current A/D sampled value, but only moving a small=20 percentage of that (towards the currently sampled A/D value, but only=20 partly there). A significant difference that persists for several A/D=20 samples will move the output gradually towards that value, but a=20 transient difference will only change the output a negligible amount. Cheers, -Neil. On 11/26/2015 3:26 AM, Jim Ruxton wrote: > I am using a pot and the high resolution mode of an A/D on the 16f1828 . > I am directly controlling a 10 bit PWM with the result of the 10 bit A/D > input. I have a problem in that I want to avoid the noise of the A/D > input from affecting my output. This happens if my pot is set just > between two levels so the output fluctuates between two levels. Not very > much only 1 or 2 levels out of the 1024 but this is significant in my > application. I really only want the output to change if I physically > move the pot. Currently I have fixed it by only outputting to the PWM on > the output if the input changes by more than 2, assuming if it does I am > moving the pot. This works in that my output is steady however it > effectively lowers my resolution as well since the output now steps only > when the pot moves more than 2 values. I was wondering if I should set > up a timer interrupt for say 1 second and if the output changes by more > than 2 during that second assume the pot is being moved and allow level > increments of 1. If it didn't move by more than 2 during that second > assume the pot isn't being moved and lock the output. Am I on the right > track here or can anyone recommend another technique . > Jim > > --=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 .