OWIN not jumping to label


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2009
    Location
    Alabama,USA
    Posts
    219

    Default OWIN not jumping to label

    I’m trying to get a OWOUTcommand to jump to a label when there is no sensor present. I have two ports on a 16F873a using 1-Wire to read DS2438 battery monitors. If there is no sensor present I want to jump to a label. I have verified that on an empty port, the master sends the reset pulse but there is no presents pulse. The program does not jump to a label as expected. On a port where there is a sensor the program works as it should. Am I setting up the command correctly to jump to a label if sensor is not present? There is no example of this in the manual. Comments Please! Thanks...
    Code:
      
    Sensor:
        OWOUT OWnet,1, [skiprom,WriteScratchpad,$00,$00],Senout
        OWOUT OWnet,1, [skiprom,ConvertT]    :pause 10
        OWOUT OWnet,1, [skipROM,ConvertV] :pause 5   
        OWOUT OWnet,1, [skipROM,RecallMemory, $00] ; Skip ROM search, Recall Memory
        OWOUT OWnet,1, [skipROM,ReadScratchpad, $00]   ; Skip ROM search, Read 
        OWIN    OWnet,2, [STR DSbuffer\9]' Read 9 bytes
        Serout2 TX_485, 84,[" 1-Wire is present on main"]
        GOSUB GetT_V
    Senout:
                    RETURN  
    ALT_Sensor:
        OWOUT OWalt,1, [skiprom,WriteScratchpad,$00,$00],Altout
        OWOUT OWalt,1, [skiprom,ConvertT] :pause 10
        OWOUT OWalt,1, [skipROM,ConvertV] :pause 5   
        OWOUT OWalt,1, [skipROM,RecallMemory, $00] 
        OWOUT OWalt,1, [skipROM,ReadScratchpad, $00] ' Skip ROM search, Read 
        OWIN  OWalt,2, [STR DSbuffer\9]' Read 9 bytes    
        Serout2 TX_485, 84,[" 1-Wire is present on Alternet"]
        GOSUB GetT_V
    Altout:
                   RETURN
    Last edited by MOUNTAIN747; - 15th March 2011 at 16:36. Reason: Label correction

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: OWIN not jumping to label

    I've checked the 1-wire presence with a different PIC and different 1-wire device, and it seems to be working ok.

    I noticed the point that your program jumps to doesn't give any indication that it jumped there.
    Maybe you could try something like this for testing purposes.

    Code:
    Sensor:
        OWOUT OWnet,1, [skiprom,WriteScratchpad,$00,$00],Senout
        OWOUT OWnet,1, [skiprom,ConvertT]    :pause 10
        OWOUT OWnet,1, [skipROM,ConvertV] :pause 5   
        OWOUT OWnet,1, [skipROM,RecallMemory, $00] ; Skip ROM search, Recall Memory
        OWOUT OWnet,1, [skipROM,ReadScratchpad, $00]   ; Skip ROM search, Read 
        OWIN    OWnet,2, [STR DSbuffer\9]' Read 9 bytes
        Serout2 TX_485, 84,[" 1-Wire is present on main"]
        GOSUB GetT_V
    RETURN
    
    Senout:
        Serout2 TX_485, 84,[" 1-Wire presence NOT DETECTED!"]
    RETURN
    DT

  3. #3
    Join Date
    Jan 2009
    Location
    Alabama,USA
    Posts
    219


    Did you find this post helpful? Yes | No

    Default Re: OWIN not jumping to label

    Thanks Darrel for taking the time to look at this. My indication of a jump or no jump was the Serout message. It there was a jump there would be no message on that port. The fact that you tested OK on another PIC tell me something, at least I have the OWOUTcommand set up right. I'll keep testing and post any new findings.

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