DT instant interrupts with mister_e keypad


Results 1 to 6 of 6

Threaded View

  1. #1
    Join Date
    Oct 2008
    Posts
    21

    Default DT instant interrupts with mister_e keypad [RESOLVED]

    DT instant interrupts with mister_e keypad (16F628A)

    I'm new to interrupts and tried DT instant interrupts by Darrel Taylor (thanks Darrel). The blinky works great with the INT_INT.

    I want for my program to sleep until woken up by the keypad then go to keypad rutine and flash led as many times as the number pressed.

    So I connected keypad's columns to PortB and tried to invoke RBC_INT. Spent few hours double checking everything. No luck.

    I had the RBC_INT working with a switch on PortB.6 before and that part worked. Sometimes it will work after I cycle the power but on the first press only (press 5, flashes 5 times), after that it won't till I shut power off again. Sometimes it won't flash the led at all. So when it works, the keypad works as well

    Schematic attached.
    Code:
    CMCON  = 7                          ' Set portA to i/o
    DEFINE   OSC  20
    
    TRISA = %00000
    TRISB = %01110000
    
    INCLUDE "DT_INTS-14.bas"            ; Base Interrupt System
    INCLUDE "ReEnterPBP.bas"            ; Include if using PBP interrupts
    include "modedefs.bas"
    include "keypad.bas"
    
    '=======================================================
    ' SCAN_ONCE is set to 1 as well as proper keypad settings inside the keypad.bas
    '=======================================================
    
    LED_Grn     var  PortA.1            
    ctr         var byte
    
    ASM
    INT_LIST  macro    ; IntSource,        Label,  Type, ResetFlag?
            INT_Handler    RBC_INT,  _Scan,   PBP,  yes
        endm
        INT_CREATE               ; Creates the interrupt processor
    ENDASM
    
    @   INT_ENABLE   RBC_INT     ; enable external (INT) interrupts
    
    Main:
    @ sleep
    goto Main
    
    '---[INT - interrupt handler]---------------------------------------------------
    Scan:
      gosub KeypadScan
    
      for ctr = 1 to key
        high led_grn
        pause 200
        low led_grn
        pause 200
      next ctr
    @ INT_RETURN
    
    end
    As always any help appreciated,
    Tom
    Attached Images Attached Images  
    Last edited by Tomexx; - 26th November 2008 at 20:24.

Similar Threads

  1. V 2.60 and DT Instant Interrupts?
    By jderson in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 22nd July 2009, 06:48
  2. DT Instant Interrupts help
    By perides in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 26th November 2008, 18:41
  3. 12F683 and DT Instant Interrupts
    By jderson in forum mel PIC BASIC Pro
    Replies: 26
    Last Post: - 22nd November 2008, 12:47
  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 : 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