Input / output using same pin


+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2005
    Location
    Portugal
    Posts
    79

    Default Input / output using same pin

    I'm thinking to use the same PIC I/O to drive a led and to be an input from a switch, this is being an input/output just by changing TRIS. It's possible isnīt it? I'm using the circuit attatched
    Attached Images Attached Images  

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,408


    Did you find this post helpful? Yes | No

    Default

    Hi,
    Yes that would work. The drawback is that the LED will be ON while you push the button.

    /Henrik Olsson.

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


    Did you find this post helpful? Yes | No

    Default

    You don't actually need R1 as R2 via the LED will pull the pin high during the input mode, and all it will do is add extra unnescessary load to the I/O pin during output mode..

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. Using LEDs as light sensors
    By skimask in forum Code Examples
    Replies: 3
    Last Post: - 30th December 2006, 22:19
  5. WPU - Input - Output pin triangle
    By sayzer in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 1st July 2006, 11:43

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts