I'm working on a PCB design with a Raspberry Pi CM module and a microcontroller with ethernet capacity. The goal is to connect the devices to the internet.

I'm currently using a normal ethernet switch, where I connect the CAT5e cables to the different devices. Using normal RJ45 connectors, magnetics, PHY and MAC. The standard setup.

I'd like to try to integrate the switch in the PCB design, while still maintaining the LAN as it should be normally. I did find a few switch IC's like the KSZ8794 and I think I can create a working switch with this, but only with a regular setup. That is with magnetics and connectors. The IC has integrated MAC and PHY modules.

When I'm trying to wrap my head around the switch concept and with not using cables I end up with a 'maybe' possibility where I'd use the switch as normal, then link a PHY and MAC IC to one of the ports and connect the MAC with an (R)MII interface to the Pi or microcontroller.

I then have very short 100BASE-T traces between the two PHY ICs instead of a cable and connector. While this does seem like a viable solution, it also feels like jumping through unnecessary hoops.

Is there a possibility of still maintaining a LAN network on my PCB, with one connector going to the outside world and with not 'simulating' a mini 100BASE-T network between the switch IC and other devices?

EDIT: Added a diagram to hopefully make it a bit more obvious:

enter image description here

  • \$\begingroup\$ Do you really need to connect both devices independently to ethernet? Could you just not use another much simpler but high speed connection between the mcu and Pi and have just the Pi connect to the network? \$\endgroup\$ Commented Feb 16, 2019 at 13:28
  • \$\begingroup\$ Yeah, ideally every component needs to be connected to ethernet. (slight addition, there is another Pi in the design that needs ethernet acces too) \$\endgroup\$
    – pascal0312
    Commented Feb 16, 2019 at 13:33

1 Answer 1


Find a switch/PHY chip that has dual (R)MII interfaces. For example: http://www.farnell.com/datasheets/2175960.pdf.

One MII to the compute module, the second RMII to the microcontroller and you have 2 ports left that you can connect to regular magnetics and bring outside.

  • \$\begingroup\$ This is almost what I'm looking for. I have a hard time searching correct switching IC's and never found one with more than 1 MAC port. I need 3 MAC ports for my design to connect with my devices. But this definitely gave me a push in the right direction. \$\endgroup\$
    – pascal0312
    Commented Feb 16, 2019 at 14:11
  • \$\begingroup\$ If you need more ports than get a second switch IC and connect two PHYs back-to-back with capacitors ("ethernet capacitive coupling"). \$\endgroup\$
    – filo
    Commented Feb 16, 2019 at 14:15
  • \$\begingroup\$ I'll keep that in mind. As far as I'm concerned, your answer + comment answered my question for designing a LAN on my pcb. \$\endgroup\$
    – pascal0312
    Commented Feb 16, 2019 at 14:17
  • \$\begingroup\$ You can also get MCUs with built-in MAC+PHY: TM4C1294, some Coldfire V2 and PIC18J60 to spare the second switch IC. \$\endgroup\$
    – filo
    Commented Feb 16, 2019 at 14:20
  • \$\begingroup\$ I already have a MCU with built in MAC from the STM32F2 Series ready. Also, I think a built-in PHY creates the same kind of problem I have now, where I don't want to trace a whole 100BASE-T interface through my PCB while still maintaining 1 RJ45 connector. \$\endgroup\$
    – pascal0312
    Commented Feb 16, 2019 at 14:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.