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)
  • RS422/485 full-duplex (rs422-485-full)
  • RS-485 half-duplex (rs485-half)

 

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 

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