The TS-4800 CPU has 3 UARTS brought out. The XUARTs compliment this by adding 4 additional UARTS with one that can be remapped for RS422. Our XUART core will support up to 8 XUARTs total so contact us for FPGA customization options if you require more, or see the #FPGA Programming section.
These are using an FPGA core we call XUARTs which have some benefits for embedded applications over traditional UARTs. XUARTs have a shared 4KB RX buffer which allows low CPU usage without losing data. The XUARTs also allow arbitrary baudrates in a simple format. We have a patch for libmodbus that allows guaranteed timing between packets for MODBUS networks with low latency requirements.
XUARTs also include an automatic TX enable for RS485 ports. This is configured by accessing the #Syscon registers. Whenever the UART is writing the RX side will automatically be silenced so characters are not echoed back.
XUARTs are different than traditional UARTs in a few ways. The XUARTs cannot set the baud rate or mode cannot be set using ioctls either manually or using utilities like setserial or stty. Manually sending a break command requires using the raw TCP api. The baud rate and mode are instead set when the XUART is initialized. For example:
eval $(xuartctl --server --port 0 --mode 8n2 --speed 9600 2>&1); ln -sf $ttyname /dev/ttyxuart0 eval $(xuartctl --server --port 1 --mode 8n1 --speed 115200 2>&1); ln -sf $ttyname /dev/ttyxuart1 eval $(xuartctl --server --port 2 --mode 8n1 --speed 38400 2>&1); ln -sf $ttyname /dev/ttyxuart2
You can specify different ports and link locations for additional UARTs if they are enabled in your FPGA. Once the /dev/ttyxuart# device is created you can treat this as a traditional UART. You can use applications like picocom, pppd, minicom, and so on directly on the UART as expected.
For using either the CPU or FPGA serial ports these are great resources for serial programming with Linux:
For more detail on XUARTs, see the Xuartctl page.
|XUART0||CN2_78||CN2_80||CN1_67 (DIO_12)||Toggle with xuart0_on and xuart0_off.|
|XUART1||CN2_92||CN2_90||N/A||Toggle with xuart3_on xuart3_off|
|XUART2||CN2_96||CN2_94||CN1_63 (DIO_14)||Toggle with xuart4_on xuart4_off.|
|XUART3||CN2_100||CN2_98||N/A||Toggle with xuart5_on xuart5_off|
|XUART0||CN1_65||N/A||N/A||This is RX only. Must be remapped by toggling syscon offset 0x16 bit 12.|
|Note:||The xuart#_on/off functions are not needed in REV 7 of the FPGA. See the #FPGA section for more details.|
To remap the XUART0 from CN2_78-CN2_80 to RX Only on CN1_65 you must set this bit in the syscon:
peekpoke 16 0xb0010016 0x1023