Input and Output on same Port


Closed Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Aug 2008
    Posts
    39


    Did you find this post helpful? Yes | No

    Default

    Thanks for the reply. I understand the 1 and 0 of each port, but in a portion I want it all an input and later on I want it all and output.

    Do I have to have a TRISE $00 before I use it as an output, and then have another TRISE $FF to use it as an input??

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Precisely.

    If you wish to use a pin (or indeed an entire Port) for Input and Output, all you do is simply change the TRIS for that pin or that whole Port before you perform any I/O.

    Once you set TRIS, it stays that way until you change it. Note that some PBP commands change TRIS on pins as required by that command, but for clarity, you should always set TRIS for whatever you happen to need it for.

    There is no restriction as to how many times you can change the TRIS status within your program.

Similar Threads

  1. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  2. Timing input pulses and re-outputting them
    By jamie_s in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 28th February 2007, 01:50
  3. Serious Serial Situation Setbacks...
    By Dansdog in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 7th February 2007, 03:46
  4. Can anyone help a beginner in a struggle?
    By douglasjam in forum mel PIC BASIC
    Replies: 1
    Last Post: - 5th May 2005, 23:29
  5. Duplicating port input to port output
    By lwindridge in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 26th April 2004, 21:43

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