Comparators - like descrite components?


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2007
    Posts
    67

    Default Comparators - like descrite components?

    If I activate one of the comparators on a PIC, does it behave completely independant of program execution and timing? Assuming I've configured for the inverting input and non-inverting input, as well as a certain pin as the output... can I just run my program then and have those 3 pins act as a "descrite comparator" all by themselves?

    I've updated a circuit and it turns out I'll need one single comparator, but it has nothing to do with my program, I could essentially add a single descrite comparator to the board and be done, but I've got 4 unused I/O's on my PIC and realized I can probably use those pins for this task without adding another component. The use of the comparator in this case is for a completely separate part of the circuit, though it's fed by the same power supply and ground so it should be electrically compatible.

    Thanks!

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    > If I activate one of the comparators on a PIC, does it behave completely independant of program execution and timing?

    Yes.

    > Assuming I've configured for the inverting input and non-inverting input, as well as a certain pin as the output... can I just run my program then and have those 3 pins act as a "descrite comparator" all by themselves?

    The Output pin will be independant (as will the input pins). The Output from the Comparator only trips a flag in a Register. It's up to your program to look at that flag if you need to... if you don't, then it's going to be a completely independant piece of hardware. Your program WILL have to initialise the pins for Analog use, select the Comparator type (usually there are several options) and set the pins for their approprate I/O.

    > but I've got 4 unused I/O's on my PIC and realized I can probably use those pins for this task without adding another component.

    You normally can't assign your own pins, they are fixed in hardware - check the Datasheet.

  3. #3
    Join Date
    Aug 2007
    Posts
    67


    Did you find this post helpful? Yes | No

    Default

    Thanks Melanie! Very helpful. That answer makes me very happy.

Similar Threads

  1. Using Comparators
    By Short_Circuit in forum Code Examples
    Replies: 4
    Last Post: - 25th November 2009, 13:57
  2. PIC 12c509 - No External timing components
    By stay_aliveuk in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 8th September 2006, 17:20
  3. Dallas Semiconductor Components Serial Numbers
    By ideaman234 in forum General
    Replies: 2
    Last Post: - 27th February 2006, 22:17
  4. Need setting to turn off 16F688 comparators
    By Thomas Williams in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 22nd December 2005, 00:39
  5. 16F88 using comparators AND the adc
    By jpeakall in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 13th May 2005, 01:08

Members who have read this thread : 1

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