I'm developing pressure measuring device. I've used MSP430F133 chip and using IAR embedded workbench. It shows pressure in 3 diff units.
I'm taking 32 samples and averaging it. Unit selection on P5, according to the unit selected output value is calculated and displayed on LCD.
now a unit "IN WC" is showing binary averaged vale of input, just for analysis.
the problem. in default unit(MM WC) values are displaying correctly
but in a test situation when pressure is released it goes down and LCD read as below
+31.8
+31.7
+31.6
+31.5
+31.4
+31.3
+31.2
+31.2
+31.1
+31.5 (wrong reading randomly between *.4 to *.7)
+30.9
As you can there is one wrong value is being displayed, I'm not able to figure out the reason.
source file link http://rapidshare.com/files/202907123/main1.c.html
Also here: http://pastebin.com/m15eaeb79 (To avoid the rapidshare download hassle)