How to set port to high impedance? TRIS seems not to be working.


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Apr 2014
    Location
    OK
    Posts
    557


    Did you find this post helpful? Yes | No

    Default Re: How to set port to high impedance? TRIS seems not to be working.

    In your example code you clear all TRIS bits making them all outputs. Try:
    Code:
    TRISA = 111111
    TRISB = 111111
    TRISC = 111111
    
    frak:
    TRISA.6 = 0
    TRISC.3 = 0
    HIGH PORTA.6
    LOW PORTC.3
    PAUSE 2
    LOW PORTA.6
    HIGH PORTC.3
    PAUSE 2
    TRISA.6 = 1
    TRISC.3 = 1
    
    TRISC.1 = 0
    TRISC.2 = 0
    HIGH PORTC.1
    LOW PORTC.2
    PAUSE 2
    LOW PORTC.1
    HIGH PORTC.2
    PAUSE 2
    TRISC = 0
    GOTO frak

  2. #2
    Join Date
    Feb 2013
    Posts
    1,158


    Did you find this post helpful? Yes | No

    Default Re: How to set port to high impedance? TRIS seems not to be working.

    As I understand, that RMW issue might happen due to current flowing in reverse direction thru the one of the led segments.
    For the latch part, I'll try one, too bad there is no search option to tell, which part has latch and which does not.

  3. #3
    Join Date
    Apr 2014
    Location
    OK
    Posts
    557


    Did you find this post helpful? Yes | No

    Default Re: How to set port to high impedance? TRIS seems not to be working.

    Newer PICs have LATx registers that eliminate the RMW issues.

  4. #4
    Join Date
    May 2013
    Location
    australia
    Posts
    2,696


    Did you find this post helpful? Yes | No

    Default Re: How to set port to high impedance? TRIS seems not to be working.

    charlieplexed correctly latx regs are not required at all
    Warning I'm not a teacher

Similar Threads

  1. 16F887 - PORT pins interfere with each other when set high/low
    By CuriousOne in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 22nd June 2020, 17:06
  2. Replies: 28
    Last Post: - 9th March 2015, 16:35
  3. How to set a pin high an keep it there?
    By ShortBus in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 1st October 2009, 17:01
  4. 16F877A Correct set up for port a
    By enigma in forum General
    Replies: 4
    Last Post: - 30th March 2008, 13:00
  5. Pulling port high
    By the_antique in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 14th November 2005, 19:18

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