Share ports


Closed Thread
Results 1 to 4 of 4

Thread: Share ports

Hybrid View

  1. #1

    Default Share ports

    Hi all,

    just a doubt i have...

    Imagine i have a circuit with a 16F88 with all ports ocupied. 6 of them are output with leds.

    Is it possible to share these 6 ports to be used as output for leds in one section of the code and as input/output for LCD in other section of the code ?

    Thanks
    .

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ruijc View Post
    Hi all,
    just a doubt i have...
    Imagine i have a circuit with a 16F88 with all ports ocupied. 6 of them are output with leds.
    Is it possible to share these 6 ports to be used as output for leds in one section of the code and as input/output for LCD in other section of the code ?
    Thanks
    .
    Sure. Set up another pin to be the back side of the LEDs.
    If you want to fire the LEDs, the 'other' pin is the ground for them. If you want to send data to the LCD, set the 'other' pin to an input. The LEDs don't light up and the LCD works normally.

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Greetings Skimask,

    This means i can hook the lcd in the same pins as the leds.

    Code speeking i can define the ports for the lcd at the top of the code and work with the leds anyway, right ?

    And when i need the LCD i just change the port related with driving the ground to the leds ( turning off the leds ) and work with the LCD.

    No more code is required except changing the state of this particular port, am i right ?

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ruijc View Post
    Greetings Skimask,

    This means i can hook the lcd in the same pins as the leds.

    Code speeking i can define the ports for the lcd at the top of the code and work with the leds anyway, right ?

    And when i need the LCD i just change the port related with driving the ground to the leds ( turning off the leds ) and work with the LCD.

    No more code is required except changing the state of this particular port, am i right ?
    Pretty much. The LEDs might blink when accessing the LCD, and you'll have to make sure that your LCD's E line is an isolated line.

Similar Threads

  1. Replies: 4
    Last Post: - 17th April 2009, 08:56
  2. Replies: 1
    Last Post: - 29th September 2007, 18:05
  3. How many serial ports can 1 PIC handle?
    By Tom Gonser in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd March 2005, 04:34
  4. making ports outputs on a 12F629
    By bartman in forum mel PIC BASIC
    Replies: 2
    Last Post: - 14th November 2004, 17:47
  5. Accessing ports ( Melanie )
    By anj in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 7th March 2004, 20:52

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