Multiplexer address control..


Closed Thread
Results 1 to 18 of 18

Hybrid View

  1. #1

    Default Multiplexer address control..

    I have a HTC4067 16x1 multiplexer, it's controlled by four lines S0, S1, S2, S3
    I have these all connected to Port B pins 4,5,6,7 respectively on my pic. This could be reversed to 7,6,5,4 if that helps.
    I'm after ideas on how to step through the input options 0-15 as per the truth table below as efficiently as possible.

    i.e. select input 0, then 1, then 2 etc etc in sequence..

    Increment a byte from 0 to 15 and mask off the 4 high bits?

    Ideally I don't want to effect the output/status etc on the PortB 0,1,2,3 during this operation..

    Name:  HTC4067TruthTable.jpg
Views: 730
Size:  57.0 KB
    Last edited by retepsnikrep; - 19th July 2018 at 08:38.

  2. #2
    Join Date
    Sep 2009
    Posts
    737


    Did you find this post helpful? Yes | No

    Default Re: Multiplexer address control..

    If you are using PIC 18F, then use simplest solution is
    LATB.4=Control.0
    LATB.5=Control.1
    LATB.6=Control.2
    LATB.7=Control.3

    EDIT:
    For PIC16

    PortBCopy var byte

    PortBCopy = PORTB
    PortBCopy .4=Control.0
    PortBCopy .5=Control.1
    PortBCopy .6=Control.2
    PortBCopy .7=Control.3
    PORTB=PortBCopy

  3. #3


    Did you find this post helpful? Yes | No

    Default Re: Multiplexer address control..

    Yes thanks, but how to step through the options in the most efficient way without disturbing ports B0-3

  4. #4
    Join Date
    Sep 2009
    Posts
    737


    Did you find this post helpful? Yes | No

    Default Re: Multiplexer address control..

    for control = 0 to 15
    LATB.4=Control.0
    LATB.5=Control.1
    LATB.6=Control.2
    LATB.7=Control.3
    next control

  5. #5
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Multiplexer address control..

    It would be quicker if you used the port bits 0-3 instead, so you could just increment the port b value.
    The quickest way also depends where the enable bit is connected.

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


    Did you find this post helpful? Yes | No

    Default Re: Multiplexer address control..

    Pedja089, In your suggested code you are treating "Control" as an array. If it is not then you are just resetting the LATx bits 16 times.
    Dave Purola,
    N8NTA
    EN82fn

Similar Threads

  1. Replies: 5
    Last Post: - 21st January 2014, 16:10
  2. How do I give a radio control car autonomous control
    By Kenjones1935 in forum General
    Replies: 190
    Last Post: - 17th January 2010, 15:40
  3. Multiplexer channel selection
    By Castor in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 19th May 2008, 10:51
  4. Using a MAX7219 (LED digit multiplexer) with a 16F88
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 11th March 2007, 21:11

Members who have read this thread : 1

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