Analog pins for digital input


Closed Thread
Results 1 to 5 of 5

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    i never tested the above suggestion but it can work. But for safety sake i will turn them to digital.

    Another solution...use ADCIN to read the pin.
    [html]
    If result<XYZ => pin is LOW
    if result>ABC => pin is HIGH.
    [/html]
    That will allow to determine your own HIGH/LOW threshold.

    Just an idea.
    Last edited by mister_e; - 8th September 2005 at 15:59.
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default

    I realize that I could just do a conversion to determine the pin's state, but I need to sit in a loop and look for a really short toggle.

    The reason I have to configure it as analog is that the signal is connected to AN1, and I need to configure AN2 & AN3 as analog. The circuit is already built and I can't change the wiring.

    I think the best solution is to do what Melanie suggested and configure the port as digital, read the pin, convert to analog, read channels 2&3, and switch back to digital.

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