DS1820 binary

Status
Not open for further replies.
The one wire devices follow a protocol that is well documented in their datasheets.

In general you first select the device you want to talk to with MATCHROM or SKIPROM. Then you can communicate with the device.
 
The one wire devices follow a protocol that is well documented in their datasheets.

In general you first select the device you want to talk to with MATCHROM or SKIPROM. Then you can communicate with the device.

any asm example ?
 
What don't you understand? It's just BCD numbers.

Edit, 75 would be 150 converted to BCD, so 0x96.

Mike.
 
Last edited:
You need to understand 2's compliment numbers.

In 2's comp the leftmost bit is assumed to be negative.
All other bits are positive.

In a 4 bit binary number the bit values are

8 4 2 1

if we choose 2's comp representation they are

-8 4 2 1

So a decimal 1 would be

0001

and a decimal -1 is
11111
because -8 +4 +2 +1 = -1 (we just added the bit values where we had a 1)

a decimal -4 would be
1100
because -8 +4 = -4

Regardless of the number of bits it is always the leftmost bit that is assumed to be negative.

But as Eric said in the case of this sensor the rightmost bit is worth .5 rather then 1

.
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…