Input question from a newbe


Closed Thread
Results 1 to 40 of 40

Hybrid View

  1. #1
    Join Date
    Jul 2011
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    Not expecting an answer from Steve because he should have collected his winnings by now

    For everyone else; I want to track when a switch (which is in an existing circuit) is pressed and was hoping to use the same approach. The problem is the voltage is 0.7V when push to make switch is open and 0V when closed and that doesn't appear to be enough of a range.

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    ADC, comparator?!? Arwe you sure it's just not a sort of open collector output you have on hand? What if you attach a pull up resistor to it.

    In meantime i'll count my millions
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    May 2004
    Location
    brighton
    Posts
    149


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    Not sure what you are trying to do but 0.7v is quite low
    but if that's what you are measuring and assuming its the correct voltage why not fed it via an op amp then adc

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    the adc is capable to do the job without the opamp in this specific case though.

    (0.7/5)*1023=143
    (0.7/5)*255=36
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    Quote Originally Posted by Bdlhome View Post
    For everyone else; I want to track when a switch (which is in an existing circuit) is pressed and was hoping to use the same approach. The problem is the voltage is 0.7V when push to make switch is open and 0V when closed and that doesn't appear to be enough of a range.

    Probably better for you to define track for your "0.7V" being presented to the PIC....

    1. Immediately being notified when the switch is pressed? - use a comparator with PIC's comparator interrupt.

    2. hopefully catching someone pressing a switch while polling the ADC Result very frequently? - use ADC and a tight main loop.

  6. #6
    Join Date
    Jul 2011
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    Quote Originally Posted by HankMcSpank View Post
    Probably better for you to define track for your "0.7V" being presented to the PIC....

    1. Immediately being notified when the switch is pressed? - use a comparator with PIC's comparator interrupt.

    2. hopefully catching someone pressing a switch while polling the ADC Result very frequently? - use ADC and a tight main loop.
    Both would probably work, although #1 is probably better for my project. Having said that, I'm using this project as a learning experience, so I will try both.

    Thanks everyone

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