Need help with interrupt


Results 1 to 7 of 7

Threaded View

  1. #1
    Join Date
    Oct 2008
    Posts
    65

    Default Need help with interrupt

    I'm trying to learn DT's Interrupt, from the original I modify a little. I added 2 buttons to trigger the external interrupt.. but don't know how, it works only on Button 1.
    Code:
    INCLUDE "modedefs.bas" 
    INCLUDE "DT_INTS-14.bas"     ; Base Interrupt System
    INCLUDE "ReEnterPBP.bas"     ; Include if using PBP interrupts
    
    TrisB = %00000111
    PortB = %00000000
    LED1   VAR  PORTB.6
    x      var  byte
    x=0
    
    ASM
    INT_LIST  macro    ; IntSource,        Label,  Type, ResetFlag?
            INT_Handler    INT_INT,  _ToggleLED1,   PBP,  yes
        endm
        INT_CREATE               ; Creates the interrupt processor
    ENDASM
    
    @   INT_ENABLE   INT_INT     ; enable external (INT) interrupts
    
    Main:
      
      PAUSE 1
      High PortB.7
      pause 20
      low PortB.7
      Pause 20
    GOTO Main
    
    '---[INT - interrupt handler]---------------------------------------------------
    ToggleLED1:  
         serout 5,2400, [$FE, 1]
         serout 5,2400,[254,192]
         SEROUT 5,2400,[" Val ",#x] ' Send x value to LCD
         TOGGLE LED1
         x=x+1
    @ INT_RETURN
    Can any one tell me what I'm missing?

    thanks in advance
    Attached Images Attached Images  

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