Instant Interrupts - Revisited


Closed Thread
Results 1 to 40 of 773

Hybrid View

  1. #1
    Join Date
    Feb 2007
    Posts
    37


    Did you find this post helpful? Yes | No

    Default POT & RCTIME works with DT_INTS-14.bas?

    Hi Darrel,

    this is my first post on this comunity. First of all I would thanks for the fantastic DT_INTS-14.bas background PWM routine.

    I have uset your SW on a 16F628 in order to drive some LED with different brightness an WORK PEFECTLY. Darrel YOU ARE GREAT!!!!!

    Now I need to use a potentiometer so set at run time the brightnes value for the LEDs, and after reading tons of html page and googled for hours, I have the founded suspect that the PBP instruction POT and RCTIME do not work with DT_INTS-14.bas.

    Can you please confirm?

    Ciao

    Leo

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


    Did you find this post helpful? Yes | No

    Default

    Leo,
    Any time you have a routine or command that counts time, an interrupt will cause the timing to be off. Since the POT command times the discharge time of a cap, an interrupt in the middle of it will cause the command to give you a faulty reading when it is resumed.

    There are several options;
    --turn off the interrupts just before your POT command (and any other timing-specific command), and restore them just after.
    --write yourself a home-made "pot" command, and use it inside the interrupts (but this only works if your interrupts are high frequency.)
    --use a "real" a/d converter, either one in the PIC or off the chip.

  3. #3
    Join Date
    Feb 2007
    Posts
    37


    Did you find this post helpful? Yes | No

    Default POT & RCTIME works with DT_INTS-14.bas?

    Many thanks tenaja for your prompt reply.
    Ciao
    Leo

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Wirecut View Post
    Many thanks tenaja for your prompt reply.
    My sentiments, exactly.
    <br>
    DT

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


    Did you find this post helpful? Yes | No

    Default

    Darrel, does your interrupt routine selectively choose which system variables to save, based on which ones are used, to save time? Or, does it save them all, regardless?

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


    Did you find this post helpful? Yes | No

    Default

    Saves them all, no matter what.

    Without an external program like VBIS for Proton, there's no way to know which system variables are being used by a particular Handler.

    But from what I've seen, while optimizing out what isn't used does increase the maximum interrupt frequency available, it only really helps if you're pushing the limits. For normal everyday interrupts (with Basic Language) the extra saves don't have that much effect, and helps provide stability.

    And as always, if you really need the speed ?
    The interrupts should be in ASM anyways. (no PBP system variables saved at all)

    Which is one of the best parts of DT_INTs.
    You can have both ASM and Basic Language interrupts in the same program.
    <br>
    DT

  7. #7
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    And all this with a minimum of efforts
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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 : 6

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