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

    If you don't have any complex math formula's in the program, you can reduce the number of T?_Save variables.

    From ReEnterPBP.bas...
    T1_Save VAR WORD
    T2_Save VAR WORD
    T3_Save VAR WORD
    T4_Save VAR WORD


    Start with T4. Comment it out and recompile. If no error, try T3, etc.

    Then try ...
    RS1_Save VAR BYTE
    RS2_Save VAR BYTE


    Might save a few bytes of RAM.

    Just remember to un-comment them if you write a program for another chip.

    DT

  2. #2
    Join Date
    May 2006
    Posts
    36


    Did you find this post helpful? Yes | No

    Default

    I am trying to use the instant interrupts to add the funnctionality of interrupts to my programs but I am having problems with the example that found on Darryl's site. I was trying to do the example with turning a LED on and off with an external interrupt but I am having some problems. I have downloaded the latest files form Darryl's site and have saved them to same folder. I have copied the code from hiw webpage also.
    I am using PICBASIC Pro vers.2.46
    I am using the PIC16F687.

    I am getting the following errors
    Error TOGGLE~1.ASM 490 : [224] local directive only for use in macros
    Error TOGGLE~1.ASM 490 : [225] undefined symbol 'iflagreg'
    Error TOGGLE~1.ASM 490 : [226] numeric constant or symbol name expected
    Error TOGGLE~1.ASM 490 : [201] ')' expected
    Error TOGGLE~1.ASM 490 : [300] too many errors

    I commented out the Wsave's that were not needed. I have some experiece with writing programs in assembly and working with interrupts. I have looked through the include files to see if I could make sense of what is going on but I am having problems figuring it out.
    Can you direct to anywhere that will give me more information about macros? Any suggestions? Thanks for your time and help.

    Josh

    EDIT
    Looking at the datasheet for the 16F687 there IS an External interrupt on RA2 instead of RB0. There is a Port change interupt on both Port A and B. Do I have to modify the file to include the interrupt on PortA? I would want to place any available interrupt pin that I can.
    Last edited by jblackann; - 31st July 2006 at 16:31.

  3. #3
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Use the MPASM assembler.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor
    If you don't have any complex math formula's in the program, you can reduce the number of T?_Save variables.
    There's no math but it didn't help. I think I'll have to try to learn enough ASM for this application. I just need TMR0 to toggle a pin every 8-10mS and TMR1 to give me a 500µS or 1000µS interval after each TMR0 rollover.

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


    Did you find this post helpful? Yes | No

    Default

    Hi Josh,

    The INT_INT should work ok, even with it on PORTA.

    For the Interrupt on change with PORTA and PORTB, just add these two lines in the ASM section right before the INT_LIST

    RBIF = RABIF
    RBIE = RABIE
    (no space at the beginning of the line)

    Then use RBC_INT. I'll add RABC_INT, C1_INT and C2_INT names in DT_INTS-14 later, but that should get you going for now.

    HTH,
      Darrel

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


    Did you find this post helpful? Yes | No

    Default

    dhouston,

    For the 12F683...
    Did you comment out the wsave2 and wsave3 variables in DT_INTS-14?

    DT

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor
    For the 12F683...
    Did you comment out the wsave2 and wsave3 variables in DT_INTS-14?
    Not until seeing your question. That seems to do it. It compiles and only uses 593 words so I think it will be OK, now.

    Will the pin change functions work with the 12F683?
    Last edited by dhouston; - 1st August 2006 at 16:16.

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


    Did you find this post helpful? Yes | No

    Default

    Awesom,

    Will the pin change functions work with the 12F683?
    Sure will.

    Add these two lines in the ASM section right before the INT_LIST

    RBIF = GPIF
    RBIE = GPIE
    (no space at the beginning of the line)

    Then use RBC_INT.
    <br>
    DT

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor
    Add these two lines in the ASM section right before the INT_LIST

    RBIF = GPIF
    RBIE = GPIE
    (no space at the beginning of the line)

    Then use RBC_INT.
    Thanks. Spending $0.25-0.30 more for the 12F683 vs. the 12F629 is worth it to be able to use Instant Interrupts.

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