Interrupt Or I Am Going To Die


Closed Thread
Results 1 to 27 of 27

Hybrid View

  1. #1
    kunguz's Avatar
    kunguz Guest


    Did you find this post helpful? Yes | No

    Question @ Move?ba Portb

    @ MOVE?BA PORTB

    IDE did not recognize this line

  2. #2
    kunguz's Avatar
    kunguz Guest


    Did you find this post helpful? Yes | No

    Question Retlw Portb.6

    RETLW PORTB.6 when I use this line in top flash block, it doesn't do anything and continue to it's job

  3. #3
    Join Date
    May 2006
    Location
    Del Rio, TX, USA
    Posts
    343


    Did you find this post helpful? Yes | No

    Default

    I shouldn't have been so brief in my first response, so here is a little more explaination. But, you would be well served to learn more about interrupts if this explaination is still confusing.

    @ MOVE?BA PORTB

    This is a PBP internal macro which reads PORTB and moves the value to W register. It results in the asm instruction: MOVF PORTB, W This is the simplist way to read PORTB to end the mismatch which triggers the interrupt on change. No variables and only one line of code are required.

    RBIF var INTCON.0

    This statement assigns the Interrupt Flag (at INTCON.0) used for the PORTB's interrupt on change to the name "RBIF" (which is what it is refered to in the PIC datasheets).

    RBIF = 0 'Clear the interrupt flag

    This statement clears the interrupt flag, which is also required before exiting the interrupt service routine (ISR), or the program will continue returning back to the ISR. No matter what type of interrupt you use, the Interrupt Flag for that particular interrupt must always be cleared before exiting the ISR, or you will end up in an endless loop.

    Steve

Similar Threads

  1. Won't go back to SLEEP after 1st Interrupt
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 29th June 2009, 09:00
  2. Can't ID interrupt source with this IntHandler??
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 3rd June 2009, 02:35
  3. Help with Analog Interrupt
    By brid0030 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 13th February 2008, 18:14
  4. NEWBIE: Some basic questions using interrupts
    By JackPollack in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 8th March 2006, 02:59
  5. USART interrupt not interrupting right
    By Morpheus in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 6th March 2005, 01:07

Members who have read this thread : 0

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