iButton

I haven't done it yet, but would also like to know. I have the data sheets for the DS1993 if anyone wants it.
 
Hi, i'm tryng to do this job using PBP and OWIN... i have some samples from maxim and the datasheets and trying to using ds1920 (temperature sensor) and some memories.....
 
You should be able to perform the Dallas "one-wire" control using C, Assembler, or just about anything. Here's example CRC code from the following Serial 12F675 / DS18B20 Project thread on Forum.Microchip;

DS18B20 Temperature Readings?

Code:
;******************************************************************
;
;  Mike McLaren's Dallas one-wire 8-bit CRC code for the DS18B20
;
;  clear the CRC variable then run each byte from the scratchpad
;  read or ROM read operation through the CRC_Calc subroutine (a
;  final CRC value of '0' indicates "good data").
;
;    void CRC_Calc ()
;    { crc ^= IOByte;
;      for (i = 0; i < 8; i++)
;      { if (crc & 0x01)
;          crc = (crc >> 1) ^ 0x8C;
;        else
;          crc =  crc >> 1
;      }
;    }
;
;  entry: IOByte contains data byte
;   exit: CRC contains cumulative CRC data
;
CRC_Calc
        movlw   d'8'            ;                                 |B0
        movwf   Count           ; setup bit counter               |B0
        movf    IOByte,W        ;                                 |B0
        xorwf   CRC,f           ;                                 |B0
        movlw   h'8C'           ; x8+x5+x4+1 polynomial           |B0
CRC_Next
        clrc                    ;                                 |B0
        rrf     CRC,f           ;                                 |B0
        skpnc                   ;                                 |B0
        xorwf   CRC,f           ; toggle b7, b3, and b2 bits      |B0
        decfsz  Count,f         ; all done? yes, skip, else       |B0
        goto    CRC_Next        ; process the next IOByte bit     |B0
        return                  ;                                 |B0
;
Good luck with your project. Regards, Mike
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…