PBP Interrupts for beginners


Closed Thread
Results 1 to 2 of 2
  1. #1
    Tomexx's Avatar
    Tomexx Guest

    Default PBP Interrupts for beginners

    Does anyone have some beginner's tutorial for using Interrupts in PicBasic Pro?

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    well almsot everything is well explain in the PicBasic book. but i just take this code example on melabs website
    Code:
    ' On Interrupt - Interrupts in BASIC
    '  Turn LED on.  Interrupt on PORTB.0 (INTE) turns LED off.
    '  Program waits .5 seconds and turns LED back on.
    
    led     var     PORTB.7
    
    
            OPTION_REG = $7f        ' Enable PORTB pullups
    
            On Interrupt Goto myint ' Define interrupt handler
            INTCON = $90            ' Enable INTE interrupt
    
    loop:   High led                ' Turn LED on
            Goto loop               ' Do it forever
    
    
    ' Interrupt handler
            Disable                 ' No interrupts past this point
    myint:  Low led                 ' If we get here, turn LED off
            Pause   500             ' Wait .5 seconds
            INTCON.1 = 0            ' Clear interrupt flag
            Resume                  ' Return to main program
            Enable
    also see this thread... http://www.picbasic.co.uk/forum/show...=&threadid=550

    hope this help you
    regards
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Replies: 2
    Last Post: - 8th February 2009, 05:10
  2. DT's Instant Interrupts trouble
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 24th November 2008, 20:48
  3. help: TMR0 interrupts disabling PORTAchange interrupts???
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th August 2008, 15:10
  4. Hardware Interrupts and PBP
    By manumenzella in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 18th January 2007, 08:16
  5. Still HSEROUT woes
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 34
    Last Post: - 11th July 2006, 21:13

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