Tuesday, August 24, 2010

Artila MSM-4S on Alix3d2 running embedded linux

Artila MSM-4S on Alix3d2 running embedded linux

This post explain how to install the MSM-4S miniPCI Serial board on Alix3d2 board running embedded linux.

Before Continue, This post were build based on my earlier post which titled Embedded Linux on Alix3d2 board PC Engines.



Assume you had succesfully build the linux on the board. The serial card detected as 8250 standard uart but somehow at regular kernel the ttySx will not work as usual, you may find that the board undeteted or even if detected the baudrate will not work as setting, definitely the kernel need tobe modified. There wasn't much support information about driver in linux. Thank's to Frank Rysanek who build the driver for linux.

Artila MSM-4S

The MSM-4S is a high performance 4-port industrial serial communication Mini-PCI module. Port P1 and P2 can be independently configured as RS-232, RS-422 or RS-485 serial Interface by adjusting the on-board DIP switch. Port P3 and P4 are dedicated RS-232 serial interface.

16C950 Compatible High Speed UART.

A high-performance 16C950 compatible UART chip with 128-byte FIFO is used for MSM-4S to improve the transmission throughput and reduce the host computer's CPU loading. Over 700Kbps data throughput for each port is guaranteed when all ports run concurrently.

Features

* Mini-PCI interface, 50 mm height only
* 2x RS-232/422/485 ports, select by DIP switch
* 2x dedicated RS-232 ports
* Baud rate from 50bps to 921.6Kbps
* 16C950 compatible UART with 128-byte FIFO
* Over 700Kbps data throughput for each port running concurrently
* Hardware auto-direction control for RS-485
* Software drivers included for Windows 2003/XP/2000/NT/98/95/ME and Linux

Injecting Driver to Kernel

Download the driver pci-16xx-1.3.3.tgz from Frank Ryasnek that support for MSM-4S, or you may download a copy from here. The kernel I'm using is linux-2.6.28.4 , this one were the nearest to tested one by Frank Ryasnek that still suported by buildroot-2009.02. The rest of the work were mainly follow the instruction from the site.

After succesfully build and running the kernel, you may find that the baud rate were not run in the same setting as your application. You still need to set the base clock frequency via setserial command (baud_base). The baud rate base clock were counted from the crystal clock used on the minipci divided by 16 (see setserial --help). My board using 14.745MHz crytal clock so the base_baud will be 14745000/16=921562.5.



The command line need to be executed as follow:

#> setserial /dev/ttyS4 baud_base 921562.5
#> setserial /dev/ttyS5 baud_base 921562.5
#> setserial /dev/ttyS6 baud_base 921562.5
#> setserial /dev/ttyS7 baud_base 921562.5


or more detail like these

#> setserial /dev/ttyS4 port 0x1400 uart 16954 irq 9 baud_base 921562.5
#> setserial /dev/ttyS5 port 0x1408 uart 16954 irq 9 baud_base 921562.5
#> setserial /dev/ttyS6 port 0x1410 uart 16954 irq 9 baud_base 921562.5
#> setserial /dev/ttyS7 port 0x1418 uart 16954 irq 9 baud_base 921562.5


These are the key to make the MSM-4S work as expected. These will help those who had probelm like me that the baudrate don not run as minicom setting.

No comments:

Post a Comment