Hi, I'm always grappling with my firmware on the PIC 16F88 trying to dust some programming.


1) Ascertained that as PIC I have 16F88
2) My temperature sensor is an LM235H
3) located on analog port 0 (PIN17)
4) The assembly scheme of sensor is:

Name:  scheme.jpg
Views: 1460
Size:  28.8 KB


I looked a bit at the results obtained in the calculations.
I used, not for my skill but sifting left and right of the codes found on line of the formulas.

Ex .:

to find the temperature, average 20 values read on the analog port and then apply the formula

Code:
temperature= (temp*10) */ quanta
and I'd like to understand why?

Also, another string makes me do this:
Code:
lcdout $ FE, 2, "Temp.", dec2 (temperatures / 100), ".", dec1 (temperatures // 100), $ DF, "C"
That is, the result obtained from the first, set it in this way to represent it on the display as a number with a comma.

But making some insights I pull out such a times table:


temp Temperature= (temp*10) */ quanta Temperature/100 Temperature//100 Display
666 32519 325,19 25,9
667 32568 325,68 25,8
668 32617 326,17 26,7
669 32666 326,66 26,6
670 32714 327,14 27,4
671 32762 327,62 27,3
672 32812 328,12 28,2
673 32861 328,61 28,1
674 32910 329,1 29
675 32958 329,58 29,8
676 33007 330,07 30,7
677 33056 330,56 30,6
678 33105 331,05 31,5
679 33154 331,54 31,4


I read in the PicBasic manual what the various mathematical operators indicate.
But what amazes me is the fact that worth
32617 corresponds to a temperature of 26.7 ° C and that to the value of
32666 corresponds to a temperature of 26.6 ° C and so on on the table.

So what is represented on the display is a lying value?

Or am I doing something wrong?

Thanks for the answers.