Instant Interrupts - Revisited


Closed Thread
Results 1 to 40 of 773

Hybrid View

  1. #1
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Thumbs up Thanks Darrel

    Hi,

    It works. Your II rules. I am using it to 100Hz and thanks for your concern.
    Regards

    Sougata

  2. #2
    Join Date
    Oct 2004
    Posts
    440


    Did you find this post helpful? Yes | No

    Default

    Interrupt for 18F's works fine.
    How to write assembly to set a variable instead of toggle led?

    Norm


    Code:
    '---[TMR1_INT - interrupt handler]------------------------------------------
    ASM
    ToggleLED1
        btg  _LED1               ; toggle the pin
        INT_RETURN
    ENDASM

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


    Did you find this post helpful? Yes | No

    Default

    That depends on the type of variable, and what you want to set it too.
    <br>
    DT

  4. #4
    Join Date
    Oct 2004
    Posts
    440


    Did you find this post helpful? Yes | No

    Default

    That depends on the type of variable, and what you want to set it too.
    INTERRUPT_SET VAR BIT
    set to 1

    Norm

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


    Did you find this post helpful? Yes | No

    Default

    Code:
    '---[TMR1_INT - interrupt handler]------------------------------------------
    ASM
    ToggleLED1
        MOVE?CT   1, _INTERRUPT_SET
        INT_RETURN
    ENDASM
    DT

  6. #6
    Join Date
    Oct 2004
    Posts
    440


    Did you find this post helpful? Yes | No

    Default

    Works good. Thank you.

    I would like to reload timer 1 on each interrupt from a variable.

    Something like:
    Code:
    wTIMER1 var TMR1L      ' access 16 bits of TMR1 
    wTimerPreload VAR WORD
    wTimerPreload  = 65211  'adjust in program
    
      
    '---[TMR1_INT - interrupt handler]------------------------------------------
    ASM
    ToggleLED1
        MOVE?CT   1, _INTERRUPT_SET    ; SET FLAG
        INT_RETURN
    
    wTIMER1 = wTimerPreload  ; in assembly
    
    ENDASM
    Norm

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


    Did you find this post helpful? Yes | No

    Default

    See this page...
    DT_INTS-14 (Timer Template)
    http://darreltaylor.com/DT_INTS-14/TimerTemplate.html

    It's in the 14-bit section, but it's pretty much the same for 18F's
    <br>
    DT

Similar Threads

  1. Clock using Instant Interrupts
    By PICpocket in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th February 2009, 22:43
  2. DT instant interrupts with mister_e keypad
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th November 2008, 21:02
  3. DT's Instant Interrupts trouble
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 24th November 2008, 21:48
  4. Keypad and DT's Instant Interrupts
    By Homerclese in forum General
    Replies: 11
    Last Post: - 27th April 2007, 07:32
  5. Replies: 1
    Last Post: - 1st November 2006, 04:11

Members who have read this thread : 4

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts