Instant Interrupts - Revisited


Closed Thread
Results 1 to 40 of 773

Hybrid View

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

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

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

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

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

  6. #6
    Join Date
    Oct 2004
    Posts
    440


    Did you find this post helpful? Yes | No

    Default

    Interrupt now OK with one time adjustable Hz.

    Is their a way to change a Hz variable before each interrupt on?
    wFREQ_Hz var word

    Something like:

    ;--- Change these to match the desired interrupt frequency -------------------
    ;--- See http://DarrelTaylor.com/DT_INTS-14/TimerTemplate.html for more Info.
    ;@Freq = 10 ; Frequency of Interrupts in Hz
    @Freq = wFREQ_Hz ; in assembly

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


    Did you find this post helpful? Yes | No

    Default

    I don't have anything ready-made for DT_INTs like that.

    But this program has a routine to calculate the timer ticks required to produce a given frequency at a given dutycycle.

    Slow speed Software PWM
    http://www.pbpgroup.com/modules/wfse...hp?articleid=6

    Just use the SetSPWM and CalcSPWM routines.
    The interrupt portion isn't compatible with DT_INTS.

    HTH,
    DT

Similar Threads

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

Members who have read this thread : 8

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