Multiplexer address control..


Closed Thread
Results 1 to 18 of 18

Hybrid View

  1. #1
    Join Date
    Aug 2005
    Location
    Michigan, USA
    Posts
    224


    Did you find this post helpful? Yes | No

    Default Re: Multiplexer address control..

    t'would be simpler/faster still if you were to use the B3..B0 pins as both the 'control' variable and 'control' I/O;

    Code:
    RES_VECT  CODE    0x0000            ; processor reset vector
        GOTO    START                   ; go to beginning of program
    ; TODO ADD INTERRUPTS HERE IF USED
    MAIN_PROG CODE                      ; let linker place main program
    START
     
    
            movlw   0x30            ; B7..B4 other I/O, B3..B0 = control
            movwf   LATB            ;
    lopo
            incf    LATB,W          ; B3..B0 bits = control, 0..15
            xorwf   LATB,W          ; wreg = differences
            andlw   0x0F            ; ignore B7..B4 bits (and control mod 16 for free)
            xorwf   LATB,F          ; update B3..B0 bits, 0..15
     
            GOTO    lopo
    Last edited by Mike, K8LH; - 25th July 2018 at 00:08.

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,705


    Did you find this post helpful? Yes | No

    Default Re: Multiplexer address control..

    if I may...
    Mike, K8LH
    that's exactly what a good forum needs

    your solution is excellent
    Warning I'm not a teacher

  3. #3
    Join Date
    Aug 2005
    Location
    Michigan, USA
    Posts
    224


    Did you find this post helpful? Yes | No

    Default Re: Multiplexer address control..

    I like pedja089's solution which is probably about as simple, efficient, and elegant as you can get with pure PBP code. He might test clearing the four LATB bits and then setting them based on if control.0 = 1 then latb.4 = 1 (or something similar).

    I have to say the code PBP generated for the "Control << 4" instruction was pretty dismal. I'm curious to see what XC8 will generate for that...
    Last edited by Mike, K8LH; - 25th July 2018 at 05:13.

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


    Did you find this post helpful? Yes | No

    Default Re: Multiplexer address control..

    I like pedja089's solution which is probably about as simple, efficient, and elegant as you can get with pure PBP code
    it is simple but I wonder if it may cause some analog channel crosstalk effects when control inputs are changed sequentially like that esp at low clock speeds , just a thought.
    Warning I'm not a teacher

  5. #5
    Join Date
    Aug 2005
    Location
    Michigan, USA
    Posts
    224


    Did you find this post helpful? Yes | No

    Default Re: Multiplexer address control..

    Oops! I didn't think of that...

Similar Threads

  1. Replies: 5
    Last Post: - 21st January 2014, 17:10
  2. How do I give a radio control car autonomous control
    By Kenjones1935 in forum General
    Replies: 190
    Last Post: - 17th January 2010, 16:40
  3. Multiplexer channel selection
    By Castor in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 19th May 2008, 11: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, 22:11

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