For the ARM Compute Cluster project, I want to automate power cycling, rebooting, and access to the serial console of each cluster node. The v2.0 ROCK64s don't have native PoE, so it's time to build a custom PCB.
Initially, I was thinking of using 74595 shift registers and 4066 quad bilateral switches, driven by SPI from the ROCKPro64. This would let me turn on/off relays and do UART multiplexing. Karl from Interweb Freenode Chats suggested a Silicon Labs CP2108 quad USB<->UART bridge. It has 16 GPIOs, which could be used for controlling relays. Another advantage of this part is that it won't require coding any special device drivers. In theory, the Linux kernel will present the four USB UARTs and the GPIOs in userspace.
Into KiCad I went and whipped up a prototype. Sent the gerbers to JLCPCB and here's what came back.
The Reflow Oven is finished, but the code for it is not. I'll be attempting to solder my first QFN in a frying pan. Using a frying pan for the first time too. This will totally work.
Solder paste stencils are awesome. Never used one of these before. Now considering them mandatory for projects like this.
After manually pick & placing the components, it's time to cook!
And we have a completed board! To test, I soldered a jumper from VBUS over to the 5V rail to power the CP2108. Under normal operating conditions, it will receive power from an ATX power supply.
The white header is a standard computer power supply peripheral jack. The green terminal block is for power to one of four ROCK64s. The pin headers are for each of the four UARTs. And a USB micro-B to connect to the ROCKPro64. The PCB and its mounting holes are identical to a ROCK64 or Raspberry Pi, so they can be stacked on top of it with standoffs.
So far so good. But does it work? No. It took some touching up around the QFN to bring it to life, then there was another challenge. There was no GPIO support for CP2108 in the Linux kernel. After some digging around LKML, I found this patch.
I compiled the patched cp210x driver and loaded it, then wrote a quick Python script to bang all of the GPIOs. We have blinky. We have clicky. It works!
This is a great prototype, and I'm glad everything worked. There are some things I want to improve. Here is the version 2.
A complete redesign of the PCB. Eliminated the voltage selection jumpers; It's 5V only now. Used the remaining GPIOs for status indicators to show what nodes are doing (e.g. booting up, running, etc.)
Also added some RC circuits driving the FETs to eliminate a glitch with the CP2108. When it is first powered on, all GPIOs go high for a short duration before the my configuration sets them low.
Design files can be found here.