Instant Interrupts - Revisited


Results 1 to 40 of 773

Threaded View

  1. #11
    Join Date
    Mar 2006
    Location
    INDIA
    Posts
    89


    Did you find this post helpful? Yes | No

    Default

    Sir Darrel Taylor.
    my counter code is working well.
    I want to counts the rising edge on INT0 and falling edge on INT1 of the pulse trains from encoder.
    How i configure interrupt on the INT1 as Falling edge and INT0 as rising edge.
    I short both pin but dont'know how to config. edge bit.

    code.
    Code:
    ' chip PIC18F4550
    DEFINE OSC 48
    INCLUDE "MODEDEFS.BAS"
    include "MYLCD.BAS"
    CMCON = 7
    ADCON1 = 15
    CVRCON = %00000000 'CVref turned off
    
    TRISB = %11111111
    w0 var word
    pause 500
    
    '-------------------------[ INT0 Interrpt setting ] -----------------------------
    INCLUDE "DT_INTS-18.bas"     ; Base Interrupt System
    INCLUDE "ReEnterPBP-18.bas"     ; Include if using PBP interrupts
    ASM
    INT_LIST  macro    ; IntSource,        Label,  Type, ResetFlag?
            INT_Handler    INT0_INT,  _ToggleLED1,   PBP,  yes
            INT_Handler    INT1_INT,  _ToggleLED2,   PBP,  yes                
        endm
        INT_CREATE               ; Creates the interrupt processor
    ENDASM
    
    @   INT_ENABLE   INT0_INT     
    @   INT_ENABLE   INT1_INT
    '__________________________________________________________________________________
    
    
    start:  lcdout $fe,1
            lcdout "count = ",dec5 w0
            pause 200
            goto start
    
    
    
    ToggleLED1:
                w0 = w0+1
                @ INT_RETURN
                
    ToggleLED2:            
                 w0 = w0+1
                @ INT_RETURN
    Last edited by precision; - 25th July 2007 at 09:53.

Similar Threads

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

Members who have read this thread : 4

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