16F872 and interrupt handling


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    44


    Did you find this post helpful? Yes | No

    Default

    Ok Darrel i´ve found the error.
    I changed the program like this and it´s working perfect.

    DISABLE
    myint:
    RBCpins = PORTB
    INTCON.0 = 0

    if rbcpins.7 <> Lastpins.7 then
    dpo1 = 0
    for lp = 0 to 20
    pause 1
    next lp
    dpo2 = 0
    for lp = 0 to 40
    pause 1
    next lp
    dpo1 = 1
    dpo2 = dpo1
    endif

    if rbcpins.6 <> lastpins.6 then
    dpo2 = 0
    for lp = 0 to 20
    pause 1
    next lp
    dpo1 = 0
    for lp = 0 to 40
    pause 1
    next lp
    dpo2 = 1
    dpo1 = dpo2
    endif
    RESUME
    ENABLE

    Maybe the error comes from the subroutine. I include the subroutine directly and it works fine.

    Thanks a lot Darrel

    PS: How you insert a code in a window like you posted it before ?

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


    Did you find this post helpful? Yes | No

    Default

    Using [code][/code] tags puts it in a window.

    At the bottom of the page, there's a box that says "Posting Rules". Inside that there's a link to vB code. Check it out. You can do all kinds of formatting.

    hth,
    DT

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


    Did you find this post helpful? Yes | No

    Default

    Darrel and ON INTERRUPT in the same thread ???
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default

    Well, I figure you can't appreciate "Instant Interrupts" until you've had to deal with ON INTERRUPT a few times.

    Got to get them started.
    <br>
    DT

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


    Did you find this post helpful? Yes | No

    Default

    I wish Melabs would be willing to replace ON INTERRUPT with DT-INT... man you have to talk to them

    Another compiler use something around that... you know which one
    Steve

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

  6. #6
    Join Date
    Jul 2007
    Posts
    74


    Did you find this post helpful? Yes | No

    Default

    is it possible to use a momentary switch (operating on 5v) as a digital input? so I can use interrupts.

Similar Threads

  1. @Darrel Taylor Interrupt ;-)
    By Robson in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 31st August 2007, 00:59

Members who have read this thread : 0

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