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

    You have to be using MPASM as the assembler.
    The default PM assembler will not work.
    <br>
    DT

  2. #2
    Join Date
    Sep 2007
    Location
    USA, CA
    Posts
    271


    Did you find this post helpful? Yes | No

    Default

    Darrel,
    How about a little tutorial on how to tell which assembler is in use, and how to switch to the mpasm?

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


    Did you find this post helpful? Yes | No

    Default

    OK, how bout this for detection ...
    Code:
    ASM
      ifdef PM_USED
           "Dude, you have to use MPASM with DT_INTS"
      endif
    ENDASM
    If you put that in your program, and try to assemble it with PM.exe, It will automatically pop-up a window in MicroCode Studio like this ...

    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=2450&stc=1&d=120694493 9" />

    Then you can just click on "Compile Using MPASM", and it will set the MPASM option and compile it.

    If it still fails to compile, you should try this ...
    http://www.picbasic.co.uk/forum/show...5&postcount=11

    I should add that to DT_INTS-14.

    hth,
    <br>
    Attached Images Attached Images  
    DT

  4. #4
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Hi DT,

    I wanted to post a "thank you" (also as an informative post).

    For the first time ever, I used your 18F routine (with RX_INT) about a minute ago.

    I saved 3100 bytes!!!

    Really very interesting for me.

    Thanks a lot for your amazing work.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

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


    Did you find this post helpful? Yes | No

    Default

    Hi sayzer,

    2 years and 3 months since you joined.
    What took you so long?

    WOW! Saved 3100 bytes. That's pretty impressive.

    Can I ask what the difference was? or maybe where the savings came from?
    <br>
    DT

  6. #6
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    Hi sayzer,

    2 years and 3 months since you joined.
    What took you so long?

    WOW! Saved 3100 bytes. That's pretty impressive.

    Can I ask what the difference was? or maybe where the savings came from?
    <br>
    The interesting part is that I did not change anything other the "int" part.

    That is why it was surprising and "Really very interesting for me".
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,170


    Did you find this post helpful? Yes | No

    Default

    You mean that comparing to On-Interrupt of PBP you did a reduction of 3100?

    Ioannis

  8. #8
    Join Date
    Feb 2003
    Location
    Sydney, Australia
    Posts
    126


    Did you find this post helpful? Yes | No

    Default Issue with Timer0 and setting prescaler

    I have been playing with the code shown below on a 16f737 as I was trying to get different prescaler values into the int routinues. As part of the testing I stripped the code right back to just be a simple interrupt with a value loaded into the pre-load registrer, but I seem to end up with an interrupt time of 204uS. According to the Timer Calc in Mister E's PicMulti Calc I should get an interrupt every 5.019mS. (see attached image for capture of the output waveform - I love my PICkit 2!)

    This code is lifted straight from Darells example with the blinky led (1-2-3 version), and all I have done is add the pre-load. I have also removed the pre-load and still get the same time for the interrupt.

    Code:
    DEFINE OSC 20
    
    rs_led      var portb.7 ' rs232 led
    led         var portc.4 ' was Data_Out line
    
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    
    INCLUDE "DT_INTS-14.bas"     ' Base Interrupt System
    INCLUDE "ReEnterPBP.bas"     ' Include if using PBP interrupts
    
    
    ASM
    INT_LIST  macro    ; IntSource,        Label,  Type, ResetFlag?
           INT_Handler   TMR0_INT,  _doBAM,   PBP,  yes
         endm
        INT_CREATE     ; Creates the interrupt processor
    ENDASM
    
    OPTION_REG = OPTION_REG & $80 | 1     'Set TMR0 Prescaler to 256, leave RBPU alone
    
    TMR0 =  158 ' preload with 158 to give 21uS interrupts (at 1:1)
    ' this should then give Interrupt every 5.019mS at 1:256
    
    @ INT_ENABLE  TMR0_INT     ; enable Timer 1 interrupts
    '~~~~~~~~~~~~~~~~~~
    
    goto main      ' jump over ISR
    
    '---[TMR0 - interrupt handler]--------------------------------------------------
    doBAM:
    toggle rs_led
    @ INT_RETURN
    
    '~~~~~~~~~~~~~~~~~~~~~~~~~~~
     high rs_led
    main:
    
    '''''''''''''''''''''''
    ' do some flashing led stuff
    '''''''''''''''''''''''
    high led
    pause 500
    low led
    pause 500
    goto main
    There has got to be something really simple I am missing...
    bill.
    Attached Images Attached Images  
    Last edited by bcd; - 1st May 2008 at 10:19. Reason: Clarification of a few things

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


    Did you find this post helpful? Yes | No

    Default

    Use OPTION_REG = %11010111

    And load the timer on every interrupt.
    <br>
    DT

  10. #10
    Join Date
    Feb 2003
    Location
    Sydney, Australia
    Posts
    126


    Did you find this post helpful? Yes | No

    Default

    Thanks,

    See told you it would be something really simple I missed..

    Code:
    doBAM:
       toggle rs_led
       TMR0 =  158     ' reload the pre-load
       @ INT_RETURN
    (Hey Darrel - how do you get your code blocks so colourful and properly indented ?)

    bill.

  11. #11
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by bcd View Post
    (Hey Darrel - how do you get your code blocks so colourful and properly indented ?)
    bill.
    http://www.picbasic.co.uk/forum/showthread.php?t=6221

    The page may take awhile to load.....

  12. #12
    Join Date
    Mar 2006
    Posts
    41


    Did you find this post helpful? Yes | No

    Default Turn Interrupt on/off

    Hello;
    I'm Ryan form the Philippines I must admit DTS-14 ints rules!!! i'd like to know how can i turn the interrupt on and off for USART continues recepton I'm using PIC16f877a toggling register PIE.5 doesn't seem to work

    Thanks

    PS.

    Part of my project i'm paying my tuition continue college again OSY for sometime now hehe (",)

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