Shop OBEX P1 Docs P2 Docs Learn Events
OWIN/OWOUT and ROM codes — Parallax Forums

OWIN/OWOUT and ROM codes

ArchiverArchiver Posts: 46,084
edited 2004-04-19 13:13 in General Discussion
Hi: I'm attempting to contact a specific 1-wire device (on a bus
that has half a dozen devices) via it's unique ROM code (which comes
back as "101ABA2700080001D").

From Stamp Editor Help:

"Match ROM=$55" ...This command, followed by a 64-bit ID, allows the
BASIC Stamp to address a specific 1-Wire® device."

so, the OWOUT looks like:

OWOUT 4,1,[noparse][[/noparse]$55,$101aba270008001d]

which generates a tokenize error "constant exceeds 16 bits". the
ROM code is specified at 64 bits.

I don't understand. can anyone help?

thanks, Steve

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2004-04-18 22:21
    You can't send out a 64-bit value like you're attempting to do -- the
    compiler is complaining because its biggest value can be 16 bits. What
    you can do is send the serial number a byte at a time, or by using the
    STR modifier. The easiest thing to do, I find, is to store your serial
    numbers in a DATA statement, then use a short loop (or array) to send
    it:

    ID0 DATA $10, $1a $ba, $27, $00, $08, $00, $1d

    ...

    Send_SN:
    OWOUT 4, 1, [noparse][[/noparse]$55]
    FOR idx = 0 TO 7
    READ IDO + idx, snByte
    OWOUT 4, 0, [noparse][[/noparse]snByte]
    NEXT


    This is just a fragment (off the top of my head, no less) to give you an
    idea. Go to this page on our web site:

    http://www.parallax.com/detail.asp?product_id=45184

    And grab the code. In it you'll find a program called PP_DS1822-2.BSP
    that shows how to connect to an individual device via its serial number.

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: stenote [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=Plc_h_iUp_mYYimzVQ96OOrygpQXKQi6ESxo4p_BjiXD_gXgtUL4Usj7m-mTm4zH_5PXhrgkhIs3pqpvVKcj]stepnote@c...[/url
    Sent: Sunday, April 18, 2004 1:33 PM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] OWIN/OWOUT and ROM codes


    Hi: I'm attempting to contact a specific 1-wire device (on a bus
    that has half a dozen devices) via it's unique ROM code (which comes
    back as "101ABA2700080001D").

    From Stamp Editor Help:

    "Match ROM=$55" ...This command, followed by a 64-bit ID, allows the
    BASIC Stamp to address a specific 1-Wire(r) device."

    so, the OWOUT looks like:

    OWOUT 4,1,[noparse][[/noparse]$55,$101aba270008001d]

    which generates a tokenize error "constant exceeds 16 bits". the
    ROM code is specified at 64 bits.

    I don't understand. can anyone help?

    thanks, Steve
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-19 02:13
    Jon: thanks. I tried, but the code in the example is too complex
    for me... and I'm stumped on your suggestion, because:

    When I drop this>
    ID0 DATA $10, $1a $ba, $27, $00, $08, $00, $1d
    > Send_SN:
    > OWOUT 4, 1, [noparse][[/noparse]$55]
    > FOR idx = 0 TO 7
    > READ IDO + idx, snByte
    > OWOUT 4, 0, [noparse][[/noparse]snByte]
    > NEXT
    into a program the tokenize halts at "snByte". If I
    declare "snByte" as a variable I'm right back into the same problem
    I started with.

    thanks, Steve


    --- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...>
    wrote:
    > You can't send out a 64-bit value like you're attempting to do --
    the
    > compiler is complaining because its biggest value can be 16 bits.
    What
    > you can do is send the serial number a byte at a time, or by using
    the
    > STR modifier. The easiest thing to do, I find, is to store your
    serial
    > numbers in a DATA statement, then use a short loop (or array) to
    send
    > it:
    >
    > ID0 DATA $10, $1a $ba, $27, $00, $08, $00, $1d
    >
    > ...
    >
    > Send_SN:
    > OWOUT 4, 1, [noparse][[/noparse]$55]
    > FOR idx = 0 TO 7
    > READ IDO + idx, snByte
    > OWOUT 4, 0, [noparse][[/noparse]snByte]
    > NEXT
    >
    >
    > This is just a fragment (off the top of my head, no less) to give
    you an
    > idea. Go to this page on our web site:
    >
    > http://www.parallax.com/detail.asp?product_id=45184
    >
    > And grab the code. In it you'll find a program called PP_DS1822-
    2.BSP
    > that shows how to connect to an individual device via its serial
    number.
    >
    > -- Jon Williams
    > -- Applications Engineer, Parallax
    > -- Dallas Office
    >
    >
    >
    Original Message
    > From: stenote [noparse][[/noparse]mailto:stepnote@c...]
    > Sent: Sunday, April 18, 2004 1:33 PM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]basicstamps] OWIN/OWOUT and ROM codes
    >
    >
    > Hi: I'm attempting to contact a specific 1-wire device (on a bus
    > that has half a dozen devices) via it's unique ROM code (which
    comes
    > back as "101ABA2700080001D").
    >
    > From Stamp Editor Help:
    >
    > "Match ROM=$55" ...This command, followed by a 64-bit ID, allows
    the
    > BASIC Stamp to address a specific 1-Wire(r) device."
    >
    > so, the OWOUT looks like:
    >
    > OWOUT 4,1,[noparse][[/noparse]$55,$101aba270008001d]
    >
    > which generates a tokenize error "constant exceeds 16 bits". the
    > ROM code is specified at 64 bits.
    >
    > I don't understand. can anyone help?
    >
    > thanks, Steve
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-19 13:13
    Well, then, until you're more comfortable with programming the BASIC
    Stamp, you can do it like this:

    OWOUT 4, 1, [noparse][[/noparse]$55, $10, $1a, $ba, $27, $00, $08, $00, $1d]

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: stenote [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=zqt4fPUIqICFWUY1fJhjPJuM0Qr6lQOoS0dToNYS1V_0jmnETC4SYrZYSScAk6qsoGcPp7MBERj2e_ko]stepnote@c...[/url
    Sent: Sunday, April 18, 2004 8:14 PM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] Re: OWIN/OWOUT and ROM codes


    Jon: thanks. I tried, but the code in the example is too complex
    for me... and I'm stumped on your suggestion, because:

    When I drop this>
    ID0 DATA $10, $1a $ba, $27, $00, $08, $00, $1d
    > Send_SN:
    > OWOUT 4, 1, [noparse][[/noparse]$55]
    > FOR idx = 0 TO 7
    > READ IDO + idx, snByte
    > OWOUT 4, 0, [noparse][[/noparse]snByte]
    > NEXT
    into a program the tokenize halts at "snByte". If I
    declare "snByte" as a variable I'm right back into the same problem
    I started with.

    thanks, Steve


    --- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...>
    wrote:
    > You can't send out a 64-bit value like you're attempting to do --
    the
    > compiler is complaining because its biggest value can be 16 bits.
    What
    > you can do is send the serial number a byte at a time, or by using
    the
    > STR modifier. The easiest thing to do, I find, is to store your
    serial
    > numbers in a DATA statement, then use a short loop (or array) to
    send
    > it:
    >
    > ID0 DATA $10, $1a $ba, $27, $00, $08, $00, $1d
    >
    > ...
    >
    > Send_SN:
    > OWOUT 4, 1, [noparse][[/noparse]$55]
    > FOR idx = 0 TO 7
    > READ IDO + idx, snByte
    > OWOUT 4, 0, [noparse][[/noparse]snByte]
    > NEXT
    >
    >
    > This is just a fragment (off the top of my head, no less) to give
    you an
    > idea. Go to this page on our web site:
    >
    > http://www.parallax.com/detail.asp?product_id=45184
    >
    > And grab the code. In it you'll find a program called PP_DS1822-
    2.BSP
    > that shows how to connect to an individual device via its serial
    number.
    >
    > -- Jon Williams
    > -- Applications Engineer, Parallax
    > -- Dallas Office
    >
    >
    >
    Original Message
    > From: stenote [noparse][[/noparse]mailto:stepnote@c...]
    > Sent: Sunday, April 18, 2004 1:33 PM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]basicstamps] OWIN/OWOUT and ROM codes
    >
    >
    > Hi: I'm attempting to contact a specific 1-wire device (on a bus
    > that has half a dozen devices) via it's unique ROM code (which
    comes
    > back as "101ABA2700080001D").
    >
    > From Stamp Editor Help:
    >
    > "Match ROM=$55" ...This command, followed by a 64-bit ID, allows
    the
    > BASIC Stamp to address a specific 1-Wire(r) device."
    >
    > so, the OWOUT looks like:
    >
    > OWOUT 4,1,[noparse][[/noparse]$55,$101aba270008001d]
    >
    > which generates a tokenize error "constant exceeds 16 bits". the
    > ROM code is specified at 64 bits.
    >
    > I don't understand. can anyone help?
    >
    > thanks, Steve



    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject
    and Body of the message will be ignored.

    Yahoo! Groups Links







    This message has been scanned by WebShield. Please report SPAM to
    abuse@p....
Sign In or Register to comment.