Hi,
Try something like:
Code:
=TRUNC((A4*20480/65536)-40)
Where A4 is the cell in which you put your TEMP value. Now, MS insists on changing the names of the functions depending on what language you're running but I think TRUNC is what you want, as long as you're running an English version of Excel - which I'm not.....here it's called AVKORTA....
This will give you a result of -39 when TEMP is 0 and 39 when TEMP is 255 and it truncates the result (instead of rounding it) just like it will when run on the PIC.
We could get it display as a real two's complement number but I'll have to dwell on that for a moment - if needed. In the meantime:
253 = -3
254 = -2
255 = -1
0 = 0
1 = 1
2 = 2
3 = 3
And so on.....
/Henrik.
Bookmarks