2
\$\begingroup\$

I need to add 32 serial ports to an SBC, for my tests I'm using a raspberry CM4, but it could also be a similar SBC.

I'm trying to figure out what solution is best for having 32 serial ports on my system. From a first analysis I understood that the only usable interfaces are USB and PCIe.

The problem is that all USB-Serial or PCI-Serial bridge chips I could find have at most 4 serial ports.

So my idea is to use 8 of these chips, for example 8 x FT4232H chips. Speed isn't critical, definitely a baud rate under 1Mbps, but I can go even slower if needed.

NOTE: Everything should then be done on a single PCB; therefore, the reasoning must be done at the chip level.

The problem now is, how to connect these 8 chips to my system, I came up with these solutions:

  • 8 port USB hub and connect a FT4232 CHIP on each port. But it's not easy to find chips to make 8-port USB hubs.

  • Chain of USB HUBs, for example a 4-port USB hub and another 2-port hub on each port. And return to a situation similar to the first one.

  • 8-port PCIe hub, but I couldn't find any suitable chip for this. Anyway, then on each PCI port put a PCIe-to-4xUART converter.

  • Mixed solution, that is, a 2 port PCie hub, then a PCie-to-4xUSB converter on each port, and I go back to having the 8 USB ports of the first solution.

In your opinion, what could be the best solution?

Are there any other solutions that I haven't come up with?

\$\endgroup\$
10
  • \$\begingroup\$ Do you need to use them all at the same time? What sort of througput do you need? For a remote-console application (only needed one at a time) I've used one UART and n DPDT relays. "Can go slower" ... how much slower? What sort of OS interface are you after? \$\endgroup\$
    – jonathanjo
    Commented Aug 31, 2023 at 15:02
  • \$\begingroup\$ Have you considered using a UART with a SPI interface - something like this? The Rpi CM4 allegedly supports up to 5 SPI interfaces, so possibly spread the 32 UARTs over 4 SPIs and then allocate an individual GPIO to each of the 32 UARTs for its SPI Chip-Select. Each SPI should be able to run at a few Mbps, so you'd get a few 100kbps continuous throughput on each UART. \$\endgroup\$
    – brhans
    Commented Aug 31, 2023 at 16:46
  • \$\begingroup\$ RS485/422 multi-drop sounds better-suited for this task. \$\endgroup\$
    – rdtsc
    Commented Aug 31, 2023 at 16:46
  • \$\begingroup\$ So eight USB to serial adapter chips is how many endpoints, plus each USB hub is an endpoint, and how many endpoints any of your SBCs even support? \$\endgroup\$
    – Justme
    Commented Aug 31, 2023 at 16:56
  • \$\begingroup\$ To answer I have to tell you more about my application, these 32 serials are used to acquire data from 32 sensors. These sensors send data following an event, therefore, either no one transmits or they transmit all together, what I liked about the FT4232 chips is that they have a 2k buffer on each serial, so even if the sensors transmit all together, the data goes into the buffer and I don't lose data. All the solutions you have proposed do not provide for the possibility of receiving from all ports at the same time. \$\endgroup\$ Commented Aug 31, 2023 at 20:21

2 Answers 2

0
\$\begingroup\$

As for products with more than 4 serial ports on a quick search found:

  1. 16-Port Low-Profile Serial Card - RS232 - PCI Express which is a PCIe card with 16 RS232 ports. The chipset is listed as:
    • ASMedia - ASM1083 which is a PCI Express-to-PCI forward bridge
    • SystemBase - SB4002A which connects Local Legacy Bus and PCI Bus
    • SystemBase - SB16C1058 which is an Octal-UART with 256 Byte Transmit/Receiver Deep FIFOs. There are two of these Octal-UARTs on the board.
  2. SIO8BX2V which is a PCIe card with Eight Channels with Multi-protocol Transceivers supporting RS422 (V.11)/RS485, RS232 (V.28). Independent Transmit and Receive FIFOs for each Serial Channel 32k byte each channel. General Standards user FPGAs to manage FIFOs which are deeper than than on standard UARTs, which might help in your application.

Another thought is that a FPGA could be used to create a custom design with multiple serial ports.

\$\endgroup\$
-2
\$\begingroup\$

Disclaimer: I never used analog multiplexers to carry digital signals, so all assumptions below are based on some documents/websites (including manufacturers sites) stating that you can use analog switches/muxes for both analog and digital signals. It would maybe be better to wait for someone more experienced with that kind of multiplexing...


You could try to use some switches or multiplexers.

TI should release the TMUX9832 sooner or later, which is a 32:1 switch, meaning that this IC allows you to redirect up to 32 data lines into a single one. By putting two of them in parallel, one for your Tx & one for Rx, you may be able to multiplex all of your 32 sensors. However, it will only available in VQFN or NFBGA form factors, which isn’t really suitable for hand soldering (although TI may also produce an "evaluation board" in the future, with all required components already mounted, as many manufacturers do).

You could also use more classic multiplexer ICs such as CD4051B and CD4052B, but you will need to combine several of them. I can think of a combination of one CD4052 & 8 CD4051, which would "only" need 5 GPIO out of your SBC plus Rx and Tx. This combination should, in theory, work (I have never tested this myself, but maybe I'll give it a try). Here is the theory:

"Stacking" multiplexers to reach 32 parallel channels On this picture (not a proper schematic, but quite understantable), inputs A,B and C (let's call them A2, B2 and C2) on CD4052B can be shared (so all 4052B have their A pin tied to the same GPIO, B pin to another...); A&B (A1 & B1) on CD4051B are "unique". Connect INH pins to GND. With all A1, B1, A2, B2, C2 low, you should be able to reach the first sensor. Switch A2 to high to reach the 2nd one, etc. Once at the "end", switch A2, B2, C2 to low and switch A1 to high, and now you reach sensor number 9. Iterate until you reached all your sensors.

One thing I like with these CD4050X is that they are available as DIP packages, so can easily be installed on breadboards (for testing) or perfboards. Also, they are quite inexpensive (around $0.5/Unit for CD4052B, $0.45/U for CD4051B), so for less than 10 bucks you should have enough ICs to try out this solution, should you want to.

\$\endgroup\$
1
  • 3
    \$\begingroup\$ The problem is, as told in the comments, and should really be mentioned in the question to prevent wrong answers, that the UARTs are needed simultaneously so they cannot be muxed. \$\endgroup\$
    – Justme
    Commented Sep 1, 2023 at 20:54

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.