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

    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.

  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

    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

  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

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

  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

    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

  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

    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.

  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

    OK. Lets stick on your first code that looks OK to me.

    What is connected to your buzzer output? Can you connect only a LED with a resistor for testing purposes?

    And I would also consider having decoupling capacitors the power rails, as close as possible to the PIC power pins.

    Maybe you have an interference of the buzzer if it is electromagnetic?

    Ioannis

  7. #7
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

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

    Hey CuriousOne, Where is the ENDIF to finish the "if BUTN=0 then" statement?
    Dave Purola,
    N8NTA
    EN82fn

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