Instant Interrupts - Revisited


Closed Thread
Results 1 to 40 of 773

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Posts
    15


    Did you find this post helpful? Yes | No

    Default RBC interupt

    read the thread many times,

    pic 18F4525
    interupt on port B.0 works great with DT add-on using int0_int
    but on falling edge of incoming pulse
    the full program runs without any problem


    i want to change it on rising edge using rbc_int
    but - pic blocks - nothing works anymore ???
    even de ledflash sub .....
    what am i doing wrong - i don't see it.


    code



    '****************************
    ' as test for RBC_int
    INTCON.0 = 0 ' RBIF
    INTCON.3 = 1 ' RBIE
    ' INTCON2.0 = 1 ' RBIP
    '****************************
    ' ok for int0_int on port B but falling edge ( unusable in this case)

    INTCON2.6 = 1 ' rising edge ????
    INTCON.1 = 0
    INTCON.4 = 1 ' enable int0 interrupt RB0
    '****************************
    ' include special interupts
    INCLUDE "DT_INTS-18.bas" ; Base Interrupt System
    INCLUDE "ReEnterPBP-18.bas" ; Include if using PBP interrupts
    INCLUDE "Elapsed_INT-18.bas" ; Elapsed Timer Routines

    ASM
    INT_LIST macro ; IntSource, Label, Type, ResetFlag?
    ; INT_Handler INT0_INT, _triggertest, PBP, yes
    INT_Handler RBC_INT, _triggertest, PBP, yes
    INT_Handler TMR1_INT, _ClockCount, PBP, yes
    endm
    INT_CREATE ; Creates the interrupt processor
    ENDASM
    gosub initial ; all var to 0
    gosub ledflash ; flash leds 10 times
    T0CON = %10010010 ; T0 = 16-bit, Prescaler 8
    ;@ INT_ENABLE INT0_INT ; enable external (INT) interrupts
    @ INT_ENABLE RBC_INT ; enable RB (INT) interrupts on change
    @ INT_ENABLE TMR1_INT ; Enable Timer 1 Interrupts

    GOSUB ResetTime ; Reset Time to 0d-00:00:00.00
    GOSUB StartTimer ; Start the Elapsed Timer


    '*******************************************
    Main:
    if trig_in =1 then
    ................
    endif

    trig_in = 0
    goto main
    '******************************************
    ';---[INT - interrupt handler]--------------------------
    triggertest:
    trig_in = 1 ' set flag interupt
    @ INT_RETURN
    end

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


    Did you find this post helpful? Yes | No

    Default

    tiger_bel,

    RBC_INT's generate an interrupt on BOTH edges of RB4 thru RB7. You can't set it to just Rising or Falling.

    Then once it interrupts, you have to read PORTB to "End the Mismatch".
    A simple Dummy = PORTB in the handler will do it.

    You also need to compare that read, with the value of PORTB the last time it interrupted to figure out which pin changed, and which state it changed to.
    <br>
    DT

  3. #3
    Join Date
    Jan 2005
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    many thanks for the info,

    i just figured out that using a simple sub to scan the port works fine...
    and i use port B.0 not 4...7

    rgds
    tb

  4. #4
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default Am I missing something ?

    Hi,

    Quote Originally Posted by tiger_bel View Post
    many thanks for the info,

    i use port B.0 not 4...7
    Then why on earth you are enabling it
    @ INT_ENABLE RBC_INT ; enable RB (INT) interrupts on change
    Regards

    Sougata

Similar Threads

  1. Clock using Instant Interrupts
    By PICpocket in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th February 2009, 21:43
  2. DT instant interrupts with mister_e keypad
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th November 2008, 20:02
  3. DT's Instant Interrupts trouble
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 24th November 2008, 20:48
  4. Keypad and DT's Instant Interrupts
    By Homerclese in forum General
    Replies: 11
    Last Post: - 27th April 2007, 06:32
  5. Replies: 1
    Last Post: - 1st November 2006, 03:11

Members who have read this thread : 6

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

Tags for this Thread

Posting Permissions

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