Shop OBEX P1 Docs P2 Docs Learn Events
Use of MATCHROM on one wire device — Parallax Forums

Use of MATCHROM on one wire device

dbjdbj Posts: 75
edited 2005-11-11 19:23 in BASIC Stamp
Still trying to make this work will tokenize but displays no DS2760 device found.

Comments

  • metron9metron9 Posts: 1,100
    edited 2005-11-11 19:23
    A quick look at the code Most of the code is commented out (I Think, never programmed using OWOUT or get commmands)
    So it looks to me that char never gets any input. Also the commas at the end of the MatchRom don't seem right to me.


    Maby add a debug instruction to see what char is at the point before it is compared with $30

    Check_Device:
    OWOUT OWpin, 8, [noparse][[/noparse]$30,$B9,$58,$F3,$10,$00,$00,$9D]' MatchROM,
    'OWIN OWpin, [noparse][[/noparse]STR ROMData\8]

    'OWOUT OW, 8, 8,[noparse][[/noparse]$30,$B9,$58,$F3,$10,$00,$00,$9D]' MatchROM,
    'OWOUT OW, 8,[noparse][[/noparse]$30,$B9,$58,$F3,$10,$00,$00,$9D]' MatchROM,
    'OWIN OW, %0010, [noparse][[/noparse]SPSTR 8] ' store in SPRAM
    'GET idx, char ' read device type
    IF (char <> $30) THEN ' if not $30, wrong device
    DEBUG "No DS2760 found."
    STOP ' stop program
    ENDIF


    perhaps

    Check_Device:
        OWOUT OWpin, 8, [noparse][[/noparse]$30,$B9,$58,$F3,$10,$00,$00,$9D]  ' MatchROM
        OWIN  OWpin,  [noparse][[/noparse]STR ROMData\8]
        OWOUT OW, 8, 8,[noparse][[/noparse]$30,$B9,$58,$F3,$10,$00,$00,$9D]   ' MatchROM
        OWOUT OW, 8,[noparse][[/noparse]$30,$B9,$58,$F3,$10,$00,$00,$9D]       ' MatchROM
        OWIN  OW, %0010, [noparse][[/noparse]SPSTR 8]                    ' store in SPRAM
        GET idx, char                                 ' read device type
      IF (char <> $30) THEN                         ' if not $30, wrong device
        DEBUG "No DS2760 found."
        STOP                                        ' stop program
      ENDIF
    
    

    Post Edited (metron9) : 11/11/2005 7:26:38 PM GMT
Sign In or Register to comment.