User's Manual

CHAPTER 3
Operations at the Application Level
49
assume that a temperature sensor is connected to the Analog7
input. Then:
Note that 2669 is A6D converted to decimal while the -40 was nec-
essary because the standard Adcon temperature sensor has a
range from -40 to 60 ºC.
Similarly, the battery level can be computed as follows:
Note here that we had to deal with an 8-bit value (59 hex = 89 dec-
imal), so the divider is 255, while the previous example was based
on a 12-bit conversion and the divider was 4095.
Temp
°C[]
2669 100u
4095
------------------------- 4 0 25.17==
Batt
V[]
89 20u
255
---------------- 6 . 9 8==