How to use interrupt on pic basic ?


Closed Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    mramos's Avatar
    mramos Guest


    Did you find this post helpful? Yes | No

    Default

    Shamir:

    There is a magazine called Nuts and Volts. It has an article this month on interrupts for PBASIC or PBISIC PRO (Sure it was the latter). Might want to get this months copy or see if parts of it are online.

  2. #2
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile another option - polling

    In some cases you can use the features of the interrupts without really using the interrupts. You can poll the interrupt bits and see when things happen. (The interrupt bits still get set even if all interrupts are disabled). In fact, this is my preferred way of handling most “interrupt issues,” even in PBP!

    For example (with a 16F628), if you wanted to use TMR0 interrupts, you could poll for the interrupt bit instead of actually using the interrupts.

    Symbol INTCON = $0B ' 16F628 location of INTCON
    Main:
    TimeLoop:
    peek INTCON, B0
    if Bit2 = 0 then TimeLoop ; no TMR0 overflow so keep polling
    poke INTCON, 0 ; TMRO overflow so reset flag

    rest of program here
    but less than overflow time of TMR0

    goto Main


    (Ihave not used PBC for 7 years but think the above format is correct)

    What interrupts are you wanting to use?

    Paul Borgmeier
    Salt Lake City, Utah
    USA

Similar Threads

  1. Pic to pic interrupt ans serial comm
    By ronjodu in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 10th May 2008, 23:43
  2. Help with Analog Interrupt
    By brid0030 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 13th February 2008, 19:14
  3. using AND as an IF statement
    By dw_pic in forum mel PIC BASIC
    Replies: 27
    Last Post: - 8th June 2006, 19:05
  4. USART interrupt not interrupting right
    By Morpheus in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 6th March 2005, 02:07
  5. How to use 93C46 Type EEPROM using PIC Basic PRo
    By in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 1st April 2003, 05: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