Andre, All you need is a little bit smarter deadband routine. You might find that a software filter is a better choice. If the transducer has a small back and forth jitter, then it will look somewhat like a fixed reading that has occasional excursions. The excursions will average out over time. You might try a simple filter where you add, say, 16 readings and then divide by 16 (just 4 shifts). This will slowly converge on the right answer. Adjust the filter constants to mask the jitter. Maybe 256 samples, maybe only 4 or 8. Experiment a little. Check the archives for software filtering; there has been lots on this topic in the past. Andre Abelian wrote: > Hi to all engineers, > > I am working on transducer that outputs 0-5v. > center position outputs 2,5v so the range is 0 - 2,5"center" - 5v > X or Y direction. The output is connected to pic ADC input and > the problem I am having is called "dead band" witch means 2,5v > may jump up or down so what we need to do is mask it that little > change won't output ant thing. > graphical way of explaining is: > > x+ direction > 2,5v |-|--------------| 5v > ^ > dead band > > I added the dead band routine that checks if the ADC=2,5v it will output value 0 > the problem with that is right after dead band I am getting 21 because of > my dead band is 20. what I need is right after dead band start with 1 so what > I did is "ADC - dead band" it took care of this problem but now I am having problem > with high side not getting to 1023 because of "- dead band". > another words right after dead band should start 1 and go all the way up to 1023. > The way I see it I have to stretch the rest of data in order to get to 1023 > but I am not sure how to do it. Should I use ADC * value ? > I am not sure if I could explain clearly? > any idea will appreciate. > > thanks > > Andre > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist