Hi kchriste I followed your three steps all of the methods gave me good results.
I tried one by one, the best method was reading the average value. That is the more accurate method.
I added a 16bit register to place the 256 times AD results.& read the higher byte to get the average value.
I wrote my own coding again & applied.
Sometimes you can see the bubbles.It means if the temperature is 21 celsious when it goes to 22 C it shifting like this 21,22,21,22,21,22,21,22 this happens continuously even if I read the average temperature.
I also applied the 2.2K resister with 0.1uF capacitor (low pass filter)
So what do you think?
Code:
;************
;Main program
;************
Display call Multiplex
Loop call Check_AD
incfsz Count256,F ;count 256 AD readings
goto $+9 ;No,
clrf Count256 ;yes, it has reached 256 times
bcf STATUS,C
rrf average_H,F ;make the value divide by 2
call BCD ;make the value into decimals
call BCD_Split ;convert into segment digits
clrf average_H ;clear 16 bit higher byte
clrf average_L ;clear 16 bit lower byte
goto Display ;show the display with updates
movf ADL,W ;take the AD result to W
addwf average_L,F ;add the value to lower byte of average register
btfss STATUS,C ;has the carry bit set?
goto Display ;No, then show the display without updates
incf average_H,F ;Yes, then increment the higher byte of average register
goto Display ;show the display without updates