ibutton ds1990 dallas


Closed Thread
Results 1 to 11 of 11
  1. #1
    davleo's Avatar
    davleo Guest

    Default ibutton ds1990 dallas

    Hi,
    I would like to know, if somebody know how to read the serial num of ibutton ds1990 dallas, with a 16fxxx . All the information a found was in asm
    thx

  2. #2
    ogranadino's Avatar
    ogranadino Guest


    Did you find this post helpful? Yes | No

    Talking help for u.

    programm...

    #include <touch.c>


    void main() {
    BYTE buffer[8];
    BYTE i;

    printf("\r\nWaiting for a touch device...\r\n");
    while (TRUE) {
    while(!touch_present()) ;
    delay_ms(200);
    if(touch_present()) {
    touch_write_byte(0x33);
    for(i=0;i<8;++i)
    buffer[i]=touch_read_byte();


    }
    }
    }

    //you need to use this lib

    ///////////////////////////////////////////////////////////////////////////
    //// Dallas Touch Driver ////
    //// ////
    //// present = touch_present() Issues a reset and returns TRUE ////
    //// if the touch device is there. ////
    //// ////
    //// data = touch_read_BYTE() Reads one BYTE from a touch device. ////
    //// ////
    //// ok = touch_write_BYTE(data) Writes one BYTE to a touch device ////
    //// and returns TRUE if all went OK. ////
    //// A FALSE indicates a collision with ////
    //// another device. ////
    //// ////
    ///////////////////////////////////////////////////////////////////////////
    //// Derivative programs created using this software in object code ////
    //// form are not restricted in any way. ////
    ///////////////////////////////////////////////////////////////////////////

    #ifndef TOUCH_PIN
    #define TOUCH_PIN PIN_B0
    #if defined(__PCH__)
    #bit TOUCH_PIN_BIT = 0xF8A.0
    #else
    #bit TOUCH_PIN_BIT = 6.0
    #endif
    #endif


    BYTE touch_read_byte() {
    BYTE i,data;

    for(i=1;i<=8;++i) {
    output_low(TOUCH_PIN);
    delay_us(14);
    output_float(TOUCH_PIN);
    delay_us(5);
    shift_right(&data,1,input(TOUCH_PIN));
    delay_us(100);
    }
    return(data);
    }

    BYTE touch_write_byte(BYTE data) {
    BYTE i;

    for(i=1;i<=8;++i) {
    output_low(TOUCH_PIN);
    delay_us(10);
    if(shift_right(&data,1,0)) {
    output_high(TOUCH_PIN);
    delay_us(10);
    if(!TOUCH_PIN_BIT)
    return(0);
    } else {
    output_low(TOUCH_PIN);
    delay_us(10);
    if(TOUCH_PIN_BIT)
    return(0);
    }
    delay_us(50);
    output_high(TOUCH_PIN);
    delay_us(50);
    }
    return(TRUE);
    }

    BYTE touch_present() {
    BOOLEAN present;

    output_low(TOUCH_PIN);
    delay_us(500);
    output_float(TOUCH_PIN);

    delay_us(5);

    if(!input(TOUCH_PIN))
    return(FALSE);
    delay_us(65);
    present=!input(TOUCH_PIN);
    delay_us(240);
    if(present)
    return(TRUE);
    else
    return(FALSE);
    }


    luck.. touch the ds1990 or ds1991 whit pin RB0(B0), and the other side to ground...

    best regards
    oscar from chile.
    Last edited by ogranadino; - 12th May 2005 at 22:08.

  3. #3
    davleo's Avatar
    davleo Guest


    Did you find this post helpful? Yes | No

    Default

    thanks oscar

  4. #4


    Did you find this post helpful? Yes | No

    Default

    There is a more easy way (use 1-wire) personal message me if you like more info

  5. #5
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    It is as simple as:

    Code:
    ' Read iButton Family Code & Serial Number
    
            TempA var byte[8]   
            iButton Var PortB.0 ' iButton connected to PortB.0
            
            OWOUT iButton,1,[$33] ' Issue Read ROM command
            Pause 100
            'Read 64 Bits (8 Bytes) into Array TempA
            OWIN iButton,0,[TempA[0],TempA[1],TempA[2],TempA[3],TempA[4],TempA[5],TempA[6],TempA[7]]
    For Reference see DS1990 Datasheet
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by nl2ttl
    personal message me if you like more info
    why? it is not the place to share our code & knowledge? it's a military secret?
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  7. #7
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e
    why? it is not the place to share our code & knowledge? it's a military secret?
    Steve, it's like with binary,
    There are only 10 types of people
    ... those who do share code,
    and those who don't
    Last edited by NavMicroSystems; - 13th May 2005 at 16:56.
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  8. #8


    Did you find this post helpful? Yes | No

    Default

    Well, i can share my code, and no problem at all but in the past i see so many poeple place mess of code, and at that moment the one how asked has already fixed it.

    Next time i post ie directly no hard feelings :P

  9. #9
    ogranadino's Avatar
    ogranadino Guest


    Did you find this post helpful? Yes | No

    Default Crc

    Hi,
    I would like to know, if somebody know how to calculate the CRC of ibutton ds1990 dallas, with a 16fxxx . All the information a found was in asm

    thanks.

  10. #10
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  11. #11
    ogranadino's Avatar
    ogranadino Guest


    Did you find this post helpful? Yes | No

    Default thanks

    thanks steve.

Similar Threads

  1. Dallas CRC8 Routines
    By Tom Estes in forum Code Examples
    Replies: 23
    Last Post: - 8th May 2018, 18:07
  2. Dallas IButton 1990 Presence pulse
    By enigma in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 15th August 2008, 22:04
  3. dallas ibutton to pics
    By CBUK in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 25th October 2006, 12:55
  4. Dallas 1-wire search Routine
    By jimbab in forum Code Examples
    Replies: 0
    Last Post: - 7th April 2006, 16:14
  5. Dallas DS1994 iButton CLOCK
    By NavMicroSystems in forum Code Examples
    Replies: 0
    Last Post: - 29th September 2004, 22:19

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts