Analog pins for digital input


Results 1 to 5 of 5

Threaded View

  1. #3


    Did you find this post helpful? Yes | No

    Default

    Hi,

    As long as you only need to read digital "input", you can leave the pin configured as analog.

    I believe TTL logic high (when using a 5 volt supply) is 2V.
    So, just read your analog input and if the voltage is higher than 2V, set a logic flag high. If it's less than 2V, set the flag low.

    That being said, you could just reconfigure the pin as Melanie suggested.
    However, it sounds like you want to leave it configured as analog for some reason.

    I'd be curious to see if you could simply read the pin's input value (not the ADC value) when it's configured as analog. It would be interesting if it registered as a 1 when the voltage was greater than 2V. You should try it.

    Cheers!
    Last edited by picnaut; - 8th September 2005 at 15:55.
    ---> picnaut

Similar Threads

  1. pic18f analog comparator problem
    By david.silaghi in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 6th May 2009, 09:38
  2. Analog input on 18f252
    By kiteman in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 12th January 2009, 08:34
  3. Analog Input on PIC16F88
    By penelopepug in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 6th May 2008, 22:49
  4. 16f88 - pin RA4 as analog input
    By savnik in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 15th December 2006, 13:55
  5. How can i control pic input pins order?
    By tanero in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 18th August 2005, 12:46

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