
This project is a bidirectional 6x6 switch bar that connects 6 input ports to 6 output ports. A single input port can be connected to one or multiple output ports. A single output port, on the other hand, can connect only to a single input at any given time.
Port selection is controlled through a serial data-in interface (IN[6]) and a latch (IN[7]). You send 18 bits into the shift register to control 6 output ports: 3 bits for each port. Once the 18 bits have been shifted, a latch signal (active high) activates output configuration. A rst_n (active low) can be used to reset the configuration.
This switch can be used to connect six UART ports as well where each port has two pins (TXD, RXD). This sketch, for example, shows:
This can be translated to the following configurations:
Configuration bits (it's binary stream without whitespace): 001 001 000 010 111 011
<img width="427" height="446" alt="switch2" src="https://github.com/user-attachments/assets/0fcd3fde-5e9c-4450-811a-0fd448f4df9b" />
Use an external microcontroller to provide configuration stream.
test_data = 18'b001_001_001_001_001_001;
shift_word(test_data);
latch_outputs();
No external hardware is required. Just connect any serial UART interface to TXD, RXD pins.
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | P1 RXD | P1 TXD | |
| 1 | P2 RXD | P2 TXD | |
| 2 | P3 RXD | P3 TXD | |
| 3 | P4 RXD | P4 TXD | |
| 4 | P5 RXD | P5 TXD | |
| 5 | P6 RXD | P6 TXD | |
| 6 | Configuration serial data in | ||
| 7 | Configuration latch |