A/D interrupt


Closed Thread
Results 1 to 5 of 5

Thread: A/D interrupt

Hybrid View

  1. #1
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: A/D interrupt

    Quote Originally Posted by starwick View Post
    Hi,
    the AN0 input is 0 unless a key is pressed
    If that's the case then why not generate an interrupt when the key (switch?) is pressed & then do an ADC in your interrupt routine.

  2. #2
    Join Date
    Feb 2010
    Posts
    17


    Did you find this post helpful? Yes | No

    Default Re: A/D interrupt

    Thanks for the replay.

    HenrikOlsson,
    That's what i was think excatelly, but it didn't hurt to ask.

    HankMcSpank,
    When a key is pressed AN0 go from 0-5v depend on the key pressed(ie; if 0 is pressed 0<AN0<.5V, if 1 is pressed .6<AN0<1.0V......).

    Thank you,
    Any other ideas or suggestions are appreciated.

  3. #3
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: A/D interrupt

    Quote Originally Posted by starwick View Post
    Thanks for the replay.

    HenrikOlsson,
    That's what i was think excatelly, but it didn't hurt to ask.

    HankMcSpank,
    When a key is pressed AN0 go from 0-5v depend on the key pressed(ie; if 0 is pressed 0<AN0<.5V, if 1 is pressed .6<AN0<1.0V......).
    Oh, now I see.

    Then what Henrik said....set a comparator to 'trip' (toggle) at anything higher than 0.4V... use that 'toggling' level to generate a comparator interrupt......do your ADC inside the comparator interrupt routine.

    Which PIC are you using? You can likely use the PIC's own internal comparator & DT's CMP_int interrupt....

    (http://darreltaylor.com/DT_INTS-14/intro.html )

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