instant interrupts with comparator


Closed Thread
Results 1 to 4 of 4

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Sure, that will work.

    You could also set the ResetFlag to YES, and just read CMCON in the handler.

    Typically, the handler would read CMCON anyway by testing the state of either the C1OUT or C2OUT bits so it can respond to the current state of the comparators.

    Right now you're just toggling an LED, so you have to read CMCON separately to end the mismatch condition.

    Once you actually do something in the comparator handler, you probably won't need the VAR1 = CMCON statement anymore.
    <br>
    DT

  2. #2
    Join Date
    Jun 2007
    Posts
    24


    Did you find this post helpful? Yes | No

    Default

    Thanks for the reply Darrel and thanks for giving us Instant Interrupt. It lets a hack like me get alot more out of a PIC than just blinking an led.

    I am using the comparator to read the output of a hall effect sensor on a flow sensor and it works a treat.

    Thanks,
    Mike

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


    Did you find this post helpful? Yes | No

    Default

    Excellent, another happy customer ...
    Don't forget to tip the waitresses.

    If you can find one ... have you seen one lately?
    My beer's empty
    DT

Similar Threads

  1. Instant Interrupts - Revisited
    By Darrel Taylor in forum Code Examples
    Replies: 772
    Last Post: - 17th February 2016, 23:14
  2. 18F2420, instant interrupts, and TMR0
    By dhickman in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 11th March 2009, 19:33
  3. Clock using Instant Interrupts
    By PICpocket in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th February 2009, 22:43
  4. DT instant interrupts with mister_e keypad
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th November 2008, 21:02
  5. DT's Instant Interrupts trouble
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 24th November 2008, 21:48

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts