MTAC-MFSER Usage

Hardware specific information for this card is available on the MTAC-MFSER page.

The multi-function serial accessory card supports these modes:

  • Loopback (default) (loopback)
  • RS-232 with RTS/CTS flow control (rs232)
    • For RS232, the supported range of speeds are (in bps): 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400, 460800, and 921600.
  • RS422/485 full-duplex (rs422-485-full)
  • RS-485 half-duplex (rs485-half)
    • For rs422-485-full with 1000ft cable, the speeds that have been tested are (in bps): 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600, 1000000, 1152000, 1500000, 2000000, 2500000, 3000000, 3500000, and 4000000.

 

Use the provided mts-io-sysfs utility to interface with the accessory card.

Examples:

Set RS-232 mode (depending on which port the card is connected to):

$ mts-io-sysfs store ap1/serial-mode rs232

OR

$ mts-io-sysfs store ap2/serial-mode rs232

Set RS-422-485-full mode (depending on which port the card is connected to):

$ mts-io-sysfs store ap1/serial-mode rs422-485-full

OR

$ mts-io-sysfs store ap2/serial-mode rs422-485-full

Launch terminal with microcom:

$ microcom -s 115200 /dev/ttyAP1
$ microcom -s 115200 /dev/ttyAP2

Ctrl-X will close the microcom session.
Additional configuration for RS-485 half duplex mode:

In addition to configuring the serial transceiver using mts-io-sysfs, the UART must also be configured for RS-485 half-duplex. mLinux provides a simple command-line utility to configure this mode using an ioctl() C call.

Note that if you are using set-rs485 in conjunction with other software that doesn’t enable RS485 mode (such as minicom), you must call set-rs485 *after* the port has been opened and initialized. Otherwise, the RS485 mode setting will be cleared when the port is initialized.

Configure UART for RS-485 half-duplex:

$ set-rs485 /dev/ttyAP1 1

Disable:

$ set-rs485 /dev/ttyAP1 0

To integrate this functionality into your own C application, see the setRS485() function in the set-rs485 source for an example:
http://git.multitech.net/cgi-bin/cgit.cgi/meta-mlinux.git/tree/recipes-extended/multitech/set-rs485/set-rs485.c

Getting Started
Basic RS422-485-full test:

  1. Install DTE card in API and DCE card in AP2 of MTCDT.
  2. Type the following commands to MTCDT:
    "mts-io-sysfs store ap1/serial-mode rs422-485-full"
    "mts-io-sysfs store ap2/serial-mode rs422-485-full"
    "mts-io-sysfs store ap1/rs4xx-term-res 1"
    "mts-io-sysfs store ap2/rs4xx-term-res 1"
  3. Connect ports together through 1000-foot Cat 5e cable.
  4. Establish to ssh connections to MTCDT and run minicom on each one. Have one minicom session use serial device /dev/ttyAP1. Have the other one use /dev/ttyAP2. Configure both for required speed with HW flow control enabled.
  5. Type some characters in each minicom session and observe whether the characters are output in the opposite minicom session.

Basic RS-232 test:

  1. Install DTE serial card in AP1, and install DCE serial card in AP2 of MTCDT.
  2. Power up the MTCDT, log in as root, and Enter the following commands: 
    mts-io-sysfs store ap1/serial-mode rs232
    mts-io-sysfs store ap2/serial-mode rs232
  3. Establish two SSH connections to the MTCDT. On one run minicom and connect to /dev/ttyAP1. On the other run minicom and connect to /dev/ttyAP2. Set both connections to required speed and hardware flow control.
  4. Connect a serial cable between the two serial cards.
  5. Type some characters in each minicom session and observe whether the characters are visible on the opposite minicom session.

File Transfer:

For further testing, you can also try transferring files between two ports using zmodem file transfer.

  1. Perform zmodem file transfers between the serial ports – first in one direction, then in the other using a utility that supports zmodem for example TeraTerm.
  2. Observe the file transfer speeds.