binaris - decimalis szubrutin

b.joe bozse at freemail.hu
Thu Nov 3 06:38:58 CET 2005


Hello elektro!

A kovetkezo kodolasra nem tud valaki egy binaris - decimalis atalakito szubrutint?
PIC16fxxx-hez kellene,
Ketto regiszter lenne a bemenet es X regiszter lenne a kimenet.

Internally, this calculation is performed by the DS1624 to provide 0.03125 C resolution. 
The temperature reading is provided in a 13 bit, 
two s complement reading by issuing READ TEMPERATURE command. 
Table 2 describes the exact relationship of output data to measured temperature. 
The data is transmitted serially through the 2 wire serial interface, MSB first. 
The DS1624 can measure temperature over the range of -55 C to +125 C in 0.03125 C increments. 
For Fahrenheit usage a lookup table or conversion factor must be used. 

TEMPERATURE/DATA RELATIONSHIPS Table 2 
TEMP         DIGITAL OUTPUT (Binary)    DIGITAL OUTPUT (Hex)
 +125C       01111101 00000000          7D00h
 +25.0625C   00011001 00010000          1910h
 +0.5C       00000000 10000000          0080h
 +0C         00000000 00000000          0070h
 -0.5C       11111111 10000000          FF80h
 -25.0625C   11100110 11110000          E6F0h
 -55C        11001001 00000000          C900h

-- 
udv.:
jozsi




More information about the Elektro mailing list