Instant Interrupts Questions


Closed Thread
Results 1 to 24 of 24

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    This might help with the printer part...
    http://www.picbasic.co.uk/forum/showthread.php?t=218
    <br>
    DT

  2. #2
    jheissjr's Avatar
    jheissjr Guest


    Did you find this post helpful? Yes | No

    Default

    I would like to use the 18F because it has a large amount of RAM and code space. Other wise I agree, I would be using a 16F. Would you mind releasing the 'governed' version of what you have so far.

  3. #3
    Join Date
    Apr 2005
    Posts
    96


    Did you find this post helpful? Yes | No

    Default

    Is the INT_INT interupt the pin B0 interrupt? If so, does the interupt trigger on the falling or rising edge?

    In the example I am working with I am using an 16F877a

    Thanks

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


    Did you find this post helpful? Yes | No

    Default

    Yes, that's the pin.

    By default, it interrupts on the Rising Edge. But it depends on the INTEDG bit in the OPTION_REG.

    OPTION_REG.6 = 0 ' INT on Falling Edge
    <br>
    DT

  5. #5
    Join Date
    Apr 2005
    Posts
    96


    Did you find this post helpful? Yes | No

    Default

    So do I just put the register declaration right after the inlcude file definitions or do I need to imbed it in your files some how? I'm looking to triger based on a falling edge.

    Thanks again

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


    Did you find this post helpful? Yes | No

    Default

    As long as you put it somewhere before the @ INT_ENABLE INT_INT you should be OK.

    <br>
    DT

  7. #7
    Join Date
    Apr 2005
    Posts
    96


    Did you find this post helpful? Yes | No

    Default

    So using your example I should put the option_reg declaration where I have it in your example below if I want the interupt to occur on the falling edge? I will try this tonight thanks alot!

    Code:
    LED1 VAR PORTB.1
    
    INCLUDE "DT_INTS-14.bas" ' Base Interrupt System
    INCLUDE "ReEnterPBP.bas" ' Include if using PBP interrupts
    
     OPTION_REG.6 = 0 ' INT on Falling Edge 
    
    ASM
    INT_LIST macro ; IntSource, Label, Type, ResetFlag?
           INT_Handler INT_INT, _ToggleLED1, PBP, yes
    endm
    
    INT_CREATE ; Creates the interrupt processor
    
    INT_ENABLE INT_INT ; enable external (INT) interrupts
    
    ENDASM
    
    Main:
    PAUSE 1
    GOTO Main
    
    '---[INT - interrupt handler]---------------------------------------------------
    ToggleLED1: 
        TOGGLE LED1
    @ INT_RETURN

Similar Threads

  1. Instant Interrupts - Revisited
    By Darrel Taylor in forum Code Examples
    Replies: 772
    Last Post: - 17th February 2016, 22:14
  2. Clock using Instant Interrupts
    By PICpocket in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th February 2009, 21:43
  3. DT instant interrupts with mister_e keypad
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th November 2008, 20:02
  4. DT's Instant Interrupts trouble
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 24th November 2008, 20:48
  5. Replies: 1
    Last Post: - 1st November 2006, 03:11

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