Instant interrupt problem (very strange)


Closed Thread
Results 1 to 3 of 3
  1. #1
    yusoweird's Avatar
    yusoweird Guest

    Unhappy Instant interrupt problem (very strange)

    I wrote a program that uses Darrel's instant interrupt. It was work perfectly. But, I accidently overwritted it. =( I am so dumb. But anyway, this is the problem I'm having since I rewrote the program...

    Code:
     
    define OSC 20    
    define LCD_EREG PORTE		
    define LCD_EBIT 0			
    define LCD_DREG PORTD       
    define LCD_DBIT 4          
    define LCD_LINES 4   
    
    define ADC_BITS 8      
    define ADC_CLOCK	3     		
    define ADC_SAMPLEUS 100
    define BUTTON_PAUSE 300         
    
    INCLUDE "DT_INTS-14.bas"     ' Base Interrupt System
    INCLUDE "ReEnterPBP.bas"     ' Include if using PBP interrupts
    
    ASM
    INT_LIST  macro    ; IntSource,        Label,  Type, ResetFlag?  
            INT_Handler    RBC_INT,  _ToggleLED2,   PBP,  yes
            INT_Handler    INT_INT,  _ToggleLED1,   PBP,  yes
        endm
        INT_CREATE               ; Creates the interrupt processor
    ENDASM
    
    pause 1000
    TRISB = %11100001                                                    
    @    INT_ENABLE   RBC_INT
    @    INT_ENABLE   INT_INT     ; enable external (INT) interrupts
    
    
        Lcdout $FE, 1,   "HELLOW WORLD"
        LCDOUT $FE, $C0
    
    Main:
    
      PAUSE 100
      
    GOTO Main
    
    '---[INT - interrupt handler]---------------------------------------------------
    
    ToggleLED2:
    lcdout "no"
    pause 100
    @ INT_RETURN
    
    ToggleLED1:
    lcdout "hi"
    pause 100
    @ INT_RETURN
    The program compiles fine, but when ever I turn on my circuit, RBC_INT is constantly interrupting. All i see is "nonononono..." on my lcd. I cant figure out why it is doing this since I did not change any hardware. Then, I reloaded my old hex file of my previous working program and RBC_INT works fine and does not constantly interrupt. I have no idea what is causing this. Please help me =(

    I forgot to say that portb0, portb5-7 are all pulled down and connected to a momentary buttons to 5V.
    Last edited by yusoweird; - 31st October 2006 at 04:51.

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


    Did you find this post helpful? Yes | No

    Default

    Hi yusoweird,

    You need to read PORTB in the interrupt routine to end the mismatch.

    <br>
    DT

  3. #3
    yusoweird's Avatar
    yusoweird Guest


    Did you find this post helpful? Yes | No

    Default

    AHH! Thanks Darrel!!!! =)

Similar Threads

  1. Instant Interrupts - Revisited
    By Darrel Taylor in forum Code Examples
    Replies: 772
    Last Post: - 17th February 2016, 22:14
  2. darrels instant interrupt problem
    By mel4853 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 23rd October 2009, 23:40
  3. Replies: 1
    Last Post: - 2nd November 2006, 23:24
  4. Interrupt Problem
    By Kamikaze47 in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 16th November 2005, 20:58
  5. Interrupt stack overflow problem with Resume {label}
    By Yuantu Huang in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 3rd May 2005, 01:17

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