Instant Interrupts Questions


Closed Thread
Results 1 to 24 of 24

Hybrid View

  1. #1
    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

  2. #2
    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

  3. #3
    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

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


    Did you find this post helpful? Yes | No

    Default

    That should work.

    Just be sure to indent the INT_CREATE and INT_ENABLE lines. You'll get an error if they are in column 1.
    <br>
    DT

  5. #5


    Did you find this post helpful? Yes | No

    Red face Troubled by RAM

    Well it seems i got to a dead end, i have most of my work done but now i am out of RAM in my 16f877A, i now HAVE TO migrate to 18f452, so i will have to do it on assembler which i really dont now very well.

    I am using portb, timer0 and RX interrupts.

    I made it to work the timer int once in this device but i have never used multiple interrupts on it, what has to be done? check flags to see which was the last interrupt? (i dont know ASM), if so, should i manage the interrupt at once or send it to other independent subroutines.

    I really am close to cry, all my work and happy moments with this Instant interrupt system seem to come to an end, even more all the work done seems to be useless.

    Please help me.

  6. #6
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    Can Instant Interrupts be used with the 12F683? If so, what changes are needed in the Include files?

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


    Did you find this post helpful? Yes | No

    Smile

    Josuetas,

    Although I have no clue what you are trying to do – you may want to consider the following: The 877A has 256 bytes of EEPROM (w/ 1,000,000 read write cycle life).

    You said you were out of RAM? All 368 bytes? I cannot imagine needing immediate access to all of these bytes. Consider reusing some RAM and tuck away the answers in EEPROM and retrieve and replace when needed? See example below.

    *** Old Way ***

    X var byte
    Y var byte
    Z var byte

    X = 1
    Y = 2
    Z = 3

    If X > 4 then DoSomething1
    If Y > 1 then Y = 6
    If Z > 6 then DoSomething3

    *** New Way ***

    Data @1,1,2,3

    X Var byte

    Read 1,X
    If X > then 4 then DoSomething1
    Read 2,X
    If X > 1 then
    Write 2, 6
    Endif
    Read 3, X
    If X > 6 then DoSomething

    ***

    The “New Way” used 1/3 the RAM of the “Old Way”. I think you get the idea. Could this work to save RAM and your past work?

    Good Luck,
    Paul Borgmeier
    Salt Lake City, Utah
    USA

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