Announcement

Collapse
No announcement yet.

MUX

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • MUX

    8 channel example:
    Click image for larger version

Name:	MUX_IC.jpg
Views:	1
Size:	234.2 KB
ID:	371050
    Click image for larger version

Name:	MUX_IC_pcb.JPG
Views:	1
Size:	473.4 KB
ID:	371051

  • #2
    Code:
    int Ctrl_A = 7;
    int Ctrl_B = 6; 
    int Ctrl_C = 4; 
    ...
      pinMode(Ctrl_A, OUTPUT);
      pinMode(Ctrl_B, OUTPUT);
      pinMode(Ctrl_C, OUTPUT);
    ...
    
    
    // ***** TRUTH TABLE *****
    //  C    B    A     "ON" Channel(S)
    // ***  ***  ***    ***************
    //  0    0    0           0
    //  0    0    1           1
    //  0    1    0           2
    //  0    1    1           3
    //  1    0    0           4
    //  1    0    1           5
    //  1    1    0           6
    //  1    1    1           7
    // *********************************  
    
    
        digitalWrite(Ctrl_A, value); // HIGH or LOW
        digitalWrite(Ctrl_B, value); // HIGH or LOW
        digitalWrite(Ctrl_C, value); // HIGH or LOW

    Comment


    • #3
      or using direct pin manipulating (approx 12 x faster):

      Code:
        DDRD |= (1<<DDD7) ; 
        DDRD |= (1<<DDD6) ; 
        DDRD |= (1<<DDD4) ; 
      ...
      
      
      // ***** TRUTH TABLE *****
      //  C    B    A     "ON" Channel(S)
      // ***  ***  ***    ***************
      //  0    0    0           0
      //  0    0    1           1
      //  0    1    0           2
      //  0    1    1           3
      //  1    0    0           4
      //  1    0    1           5
      //  1    1    0           6
      //  1    1    1           7
      // *********************************  
      
      
      
      
      // PORTD &=~ (1<<PORTD7);  // (LOW); // OR
      // PORTD |=(1<< PORTD7);   // (HIGH);
      // PORTD &=~ (1<<PORTD6);  // (LOW); // OR
      // PORTD |=(1<< PORTD6);   // (HIGH);
      // PORTD &=~ (1<<PORTD4);  // (LOW); // OR
      // PORTD |=(1<< PORTD4);   // (HIGH);

      Comment


      • #4
        This was specific demand, to select between 8 stereo channels.
        Things can be more interesting if inhibit was included in to be controlled by mcu.
        Davor pointed me on Vee "problematic" when line level signals are switched so i added 7660 as the easiest choice for me at the moment.
        Things can be done even simpler.
        ...
        Consider this as Easter treat.
        Click image for larger version

Name:	Easter.jpg
Views:	1
Size:	80.3 KB
ID:	353841

        Comment


        • #5
          Two more pins to separately control inhibits = 16 single channels (pcb not valid in this case).

          Comment

          Working...
          X