16F887 - PORT pins interfere with each other when set high/low


Closed Thread
Results 1 to 24 of 24

Hybrid View

  1. #1
    Join Date
    Feb 2013
    Posts
    1,124


    Did you find this post helpful? Yes | No

    Default Re: 16F887 - PORT pins interfere with each other when set high/low

    As far as I understand PBP manual and in practice before, HIGH PORTX.Y makes that pin high and LOW PORTX.Y makes that pin low.

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default Re: 16F887 - PORT pins interfere with each other when set high/low

    TRISB.7=1 makes portb.7 an input

    TRISB4.=1 makes portb.4 an input

    TRISB.7=0 makes portb.7 an output

    TRISB4.=0 makes portb.4 an output

    Is this really what you want?

    Ioannis

  3. #3
    Join Date
    Feb 2013
    Posts
    1,124


    Did you find this post helpful? Yes | No

    Default Re: 16F887 - PORT pins interfere with each other when set high/low

    No. I want to make PORTB.7 output logical "1" and then logical "0". PBP statements like HIGH PORTB.7 work, but only if I do not read PORTA.0 as input.

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default Re: 16F887 - PORT pins interfere with each other when set high/low

    So, why in your loop, you use TRIS to make the ports input then output? You should use High Portb.7 or Low Portb.7 and not TRIS. TRIS is only to define the input or output operation.

    Ioannis

  5. #5
    Join Date
    Feb 2013
    Posts
    1,124


    Did you find this post helpful? Yes | No

    Default Re: 16F887 - PORT pins interfere with each other when set high/low

    If you check my post, initially I was using HIGH/LOW. But it does not work. TRIS works, but not completely.

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default Re: 16F887 - PORT pins interfere with each other when set high/low

    You insist on TRIS. The purpose of TRIS is completely different than what you trying to do...

    You set once on the top of your program what every port will be (input or output) with the TRIS command and then you do not touch it again. Except if you want to change a port from output to input intentionally.

    If you want to control the state of an output port you only use High and Low of that specific port.

    Ioannis

  7. #7
    Join Date
    Feb 2013
    Posts
    1,124


    Did you find this post helpful? Yes | No

    Default Re: 16F887 - PORT pins interfere with each other when set high/low

    I absolutely do not care about what statement it will be.
    I'm asking why it does not works, whenever it is HIGH/LOW or TRIS.

Similar Threads

  1. Replies: 10
    Last Post: - 14th April 2014, 20:47
  2. 16F887 PORTC.7 high
    By Neosec in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 31st March 2013, 22:39
  3. Help in trying to set pins functions
    By MinesCoffee in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 8th December 2012, 18:03
  4. PortB pins will not initialize LOW, only HIGH?
    By ronbowalker in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 8th December 2009, 19:27
  5. Replies: 0
    Last Post: - 25th May 2005, 10:35

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