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 Re: Instant Interrupts - Revisited

    Ioannis,

    On those chips, the IOCIF bit is read-only and only gets cleared when ALL of the IOCBF flags are clear.
    So you can set the INT_Handler's ResetFlag option to NO.

    Then be sure the IOCBF flags are cleared before exiting the ISR.
    Also, take a look at section 13.4 in the datasheet regarding clearing the flags.
    DT

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    Excellent! Works terrific now.

    These chips are a little pain in setting them.

    Thanks Darrel.

    Ioannis

  3. #3
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    Use the code in post#27, (new approch to rotary encoder) is more efficient and you can achieve even higher frequency.

    Cheers

    Al.
    Last edited by aratti; - 14th January 2012 at 15:45.
    All progress began with an idea

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    Hi Al. I am using the #27 ISR.

    The thing that I added was the check for the 4 counts before Q_Count variable is incremented or decremented.

    Thats because the encoder I use produces 4 pulses on every step I turn the knob. Thanks Henrik for noting this.

    Ioannis

  5. #5
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    The code was written to read quadrature count. Any rotary encoder with two channels will generate quadrature count.

    Al.
    All progress began with an idea

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    Yes that is correct. So the Q_count variable is incrementing by 4.

    Ioannis

  7. #7
    Join Date
    Sep 2010
    Location
    Las Vegas, NV
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    If this topic was previously mentioned, I apologize for not finding it.

    I'm using a 16F877A with a 4 MHz crystal and two 22pf caps with a LED hooked up to portb.1 and the code from example 2 of DT_ints-14.bas on DTs site. I'm using a oscope to look at the timing of the LED flashes and they are occuring around 950msec apart.

    My question is, is there a way to tune the oscillator or modify DT interrupts to get it closer to a true 1 second pulse time? I know it's not far off but I was trying to learn something and maybe make it more accurate at the same time. Your help would be appreciated.

    Yes I did read the datasheet but I couldn't find anything like OSC tune that I've seen for the 12F683.

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

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