Use a PIC ADC like a fast interrupt comparator?


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: Use a PIC ADC like a fast interrupt comparator?

    Quote Originally Posted by pxidr84 View Post
    Hi everyone,

    It's possible to use a PIC ADC like a fast comparator?
    Interesting....to have a PIC ADC act as a fast sw comparator, would require the PIC to do nothing else but continually check ADC samples (samples sourced from the special event trigger).....else trapping the condition would be time dependent on how often you checked in your main program.

    I guess you could use a very basic PIC programmed to do this...and then raise an interrupt to the main pic via a logic level change/IOC pin (but then there's not much win then over using a std external hw comparator)

    I actually wish they did multi processor low end PICs! (something like an SOIC16 package but with two PIC MCUs inside!), where simple background tasks could run on one PIC, with it interrupting the other partner PIC when something of interest happened!
    Last edited by HankMcSpank; - 17th August 2011 at 00:47.

  2. #2
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default Re: Use a PIC ADC like a fast interrupt comparator?

    I think the first question is - what do you mean by *fast*? 1nSec? 100nSec? 1uSec? 10uSec? 100uSec?...
    Charles Linquist

  3. #3


    Did you find this post helpful? Yes | No

    Default Re: Use a PIC ADC like a fast interrupt comparator?

    Quote Originally Posted by Charles Linquis View Post
    I think the first question is - what do you mean by *fast*? 1nSec? 100nSec? 1uSec? 10uSec? 100uSec?...
    I mean the fastest latency.

    But the best way is to use an external comparator, like Henrik said, connected to an INT0/1/2 digital input.

  4. #4
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default Re: Use a PIC ADC like a fast interrupt comparator?

    Again... HOW MUCH LATENCY IS ACCEPTABLE?? Is 1nSec too much? is 1millisecond too much? Give us a number!
    Charles Linquist

  5. #5


    Did you find this post helpful? Yes | No

    Default Re: Use a PIC ADC like a fast interrupt comparator?

    Quote Originally Posted by Charles Linquis View Post
    Again... HOW MUCH LATENCY IS ACCEPTABLE?? Is 1nSec too much? is 1millisecond too much? Give us a number!
    Few µs (1-10µs.)

  6. #6
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default Re: Use a PIC ADC like a fast interrupt comparator?

    I haven't tried it (yet), but I believe that if you run an 18F chip at 40Mhz, and write an ISR in ASM, you can probably get the latency down to about 25uSec.
    Charles Linquist

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