Can't make RA1 a digital Input on (10 out of 20) 16F887.


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: Can't make RA1 a digital Input on (10 out of 20) 16F887.

    Try this wild guess:

    IF PORTA.1 = 0 THEN
    PORTE.1 = 0
    ELSE
    PORTE.1 = 1
    ENDIF
    Robert


    EDIT: I also went through the datasheet and can't see any register you could have forgotten.
    Last edited by Demon; - 29th September 2013 at 01:58.

  2. #2
    Join Date
    Sep 2013
    Posts
    6


    Did you find this post helpful? Yes | No

    Default Re: Can't make RA1 a digital Input on (10 out of 20) 16F887.

    Thanks for the reply.

    I gave that a try and still have the same results. I was originally using variable names for each pin, but removed them to simplify.

    I have done a lot of programming without problem. Can't believe I can't make an input work.
    In my larger program, I actually save this pin state to a USB flash drive. The input is always 0.
    The ANSEL = 0 and ANSELH = 0, is working for all the other pins they deals with.


    Paul

  3. #3
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: Can't make RA1 a digital Input on (10 out of 20) 16F887.

    Found it:

    TRISA = %000000010
    I count 9 digits.

    Robert

Similar Threads

  1. 16f887 portc input problems
    By lockjawz in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 31st March 2011, 15:02
  2. Replies: 2
    Last Post: - 1st May 2009, 09:23
  3. Really slow digital input
    By mbw123 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 30th March 2007, 05:06
  4. 18F4550 digital input
    By mbw123 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 29th March 2007, 03:43
  5. Replies: 2
    Last Post: - 5th June 2005, 20:55

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