TS-MODEM

From embeddedTS Manuals
TS-MODEM
TS-MODEM.jpg
Documents
Schematic

Overview

The TS-Modem is an add-on PC/104 modem daughter board. It adds one AT-command style compatible Modem that can be directly connected to a dial-up telephone line. The modem interface is a 16C550A compatible UART with 16 byte TX/RX FIFOs. The I/O port address and the IRQ used can be set with jumper blocks on the board itself. Typically, the TS-Modem comes with a 33Kbaud modem, though it can be purchased with the optional feature of a 56Kbaud modem. The TS-Modem can also be purchased with the optional 16-bit PC/104 connector, which is required if using IRQ 10, 11, 12,14, or 15. The TS-Modem can also be purchased with the optional on-board speaker, which is useful during development to monitor call progress. The modem speaker can be turned off by removing a jumper.

The TS-Modem comes with the following features.

  • Data Modem at line speeds of 33.6Kbps (optional 56Kbaud upon request)
  • Uses industry standard AT style commands.
  • NVRAM directory and profile storage.
  • Tone and Pulse dialing
  • Optional Speaker can be disabled/enabled with Jumper
  • COM PORT Jumper Selectable as COM1 thru COM6.
  • Uses IRQ 3-7, 9-12, 14-15
  • +5V operation
  • RJ11C (telephone line) connector

Specifications

  • Bus: PC/104 8-bit or 16-bit
  • Flow Control: XON/XOFF (Software), RTS/CTS (hardware)
  • Interface: Serial 16C550A UART with 16 byte FIFOs
  • Power: (typical) +5V @ 200 mA.
  • Operating Temperature: 0-70? C
  • Dimensions: 3.6 x 3.8 inches
  • Non condensing relative humidity: 20%-90%
  • Data modes supported: ITU-V.90, K56flex ; ITU-T V.34 enhanced, V.34, V.34bis, V.34, V.22 bis, V.22; Bell 212A and 103/133; ITU-T V.21 & V.23
  • Error Correction/Compression: ITU-T V.42 (LAP-M or MNP 2-4)

Modem Features

  • Caller ID (United States configuration only)
  • TIA-602 command compatibility
  • Autodial, redial, Auto-answer
  • Pulse or Tone dialing
  • Automatic detection of optimal modem speed/standard upon connection
  • DTMF detection
  • Auto-parity and data rate selections
  • DTR dialing
  • NVRAM storage for user-defined parameter
  • Call status display
  • Full Duplex over dial-up lines
  • 50 character command buffer

Configuration of the TS-Modem

The TS-Modem can be configured to operate on one of COM1 to COM6, and to use an IRQ of 3-7, 9-12, 14-15. The default shipping of the unit is to use COM4 on IRQ7 with the speaker set to on.

Removing JP SPKR can turn disable the optional on-board speaker. To select which COM port the unit will use, the jumpers labeled COM1 to COM6 are used. The selected COM port is determined by the "sum of" installed COM jumpers. To use COM 1, 2, or 3 put one jumper the labeled jumper of your choice. To use COM4, put one jumper on COM1 and another jumper on COM3 (1+3=COM4). To select COM5, put jumpers on COM2 and COM3, and to select COM6, put jumpers on COM 1, 2, and 3. The same method is used when selecting the desired IRQ. To select IRQ7 for example, put jumpers on both IRQ3 and IRQ4.

The following tables illustrate how to select an IRQ and COM port.

Table 1: JP configuration of COM port
JP COM1 JP COM2 JP COM3
COM 1 X
COM 2 X
COM 3 X
COM 4 X X
COM 5 X X
COM 6 X X X
Table 2: JP configuration of IRQ port
JP IRQ3 JP IRQ4 JP IRQ5 JP IRQ6
IRQ 3 X
IRQ 4 X
IRQ 5 X
IRQ 6 X
IRQ 7 X X
IRQ 9 X X
IRQ 10 X X
IRQ 11 X X
IRQ 12 X X X
IRQ 14 X X X
IRQ 15 X X X

Table 3 shows the IO location that each COM port uses.

Table 3: Base IO location of COM ports
COM port Base I/O location (In hex)
COM1 0x3F8
COM2 0x2F8
COM3 0x3E8
COM4 0x2E8
COM5 0x3A8
COM6 0x2A8

Communicating With the Modem

For a complete set of AT commands, please contact us, or see our web site for a PDF.

The modem uses AT-style commands. All commands start with an "AT" when in command mode, and when in data mode, start with "+++". For example, to dial out, the command "ATDT (phone number)" is used. To hang up after the modem has connected, use the command "+++ATH".

The modem can be used with any operating system, such as Linux or DOS. Any typical modem program can be used. In Linux, for example, minicom works quite well. Be sure to use setserial for setting which IRQ minicom and Linux should use.

The following C source code demonstrates how to directly talk to the modem from within DOS. This program puts into the modem's UART whatever characters passed to the program. For example, to test the modem and the phone line connected to it by dialing out to a known good number, one would invoke the program as such:

Minit.exe ATDT5555555

This would dial out to the number 555-5555.

This program assumes the TS-Modem is jumpered to use COM4 for the modem's I/O location. This program was written in Turbo C 3.0.

#include <stdio.h>
#include <dos.h>
#include <io.h>
#define COM1 0x3F8
#define COM2 0x3E8
#define COM3 0x2F8
#define COM4 0x2E8

int main (int argc, char *argv[] ) {
   int I=0;
   while (argv[1][I] != '\0' ) {
      if ( (inportb(COM4+0x05 ) & 0x32) !=0) //is com x LSR bit5 zero?
      {
        printf ("char %c\n", argv[1][I];
        outportb (COM4, argv[1][I]);
        I++;
      }
   }
   delay (1);
   outportb(COM4, 13);
   return 0;
}

Quick Start Guide

This guide is intended to provide a quick example for how to get a PC104 UART device up and running. The instructions below represent the use of a TS-7800 SBC. The procedure for other SBC will vary slightly between models.

These lines of code can be added to a convenient place in the linuxrc, or typed in manually from the initial ramdisk (initrd) before Debian has been loaded. The demonstration board is jumpered for COM4 on IRQ 7.

pc104on
insmod /mnt/root/lib/modules/<version>/kernel/drivers/serial/ts7800_isa16550.ko io=0x2E8 irq=7
mdev -s

Note \<version\> must be replaced with your applicable linux kernel version (as of this authoring, 2.6.24-ts or 2.6.34). You can discover what tty device the modem was installed on by typing:

dmesg | grep serial


The output from this command will look something like this:

serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 3) is a 16550A
serial8250.1: ttyS1 at MMIO 0xf1012100 (irq = 4) is a 16550A
serial8250: ttyS2 at MMIO 0xee0002e8 (irq = 71) is a 16550A


Note the third serial port's IRQ has been assigned as 71 instead of 7. This is due to the manner in which the TS-7800 handles the PC104 bus, and will be different between different SBC models.
Finally, to test the modem has been installed and is ready to use, use your favorite terminal program to talk to the modem. In the case of our example:

ts7800:~# picocom /dev/ttyS2 -b38400
picocom v1.4

port is        : /dev/ttyS2
flowcontrol    : none
baudrate is    : 38400
parity is      : none
databits are   : 8
escape is      : C-a
noinit is      : no
noreset is     : no
nolock is      : no
send_cmd is    : ascii_xfr -s -v -l10
receive_cmd is : rz -vv

Terminal ready
at
OK
atz
OK
ath0
OK

Note the default baud rate to communicate with the modem is 38400.

Jumpers

There are several jumper settings which are important to the operation of the TS-MODEM. These are described in the table and following paragraph below:

JP Desc
SPKR Speaker Enable
COM1 io = 0x3F8
COM2 io = 0x2F8
COM3 io = 0x3E8
IRQ3 irq = 3
IRQ4 irq = 4
IRQ5 irq = 5
IRQ6 irq = 6

Higher COM and IRQ can be selected by combining the above jumpers with an additive effect. Eg. COM1 + COM3 = COM4, or IRQ3 + IRQ4 = IRQ7. The board's stated maximums are COM6 and IRQ 15, however this will also be dependent on the controlling SBC, as some do not support all IRQ on the PC104 bus. I/O addresses for the upper COM ports are listed thus:

COM IO Address
COM4 0x2E8
COM5 0x3A8
COM6 0x2A8

Usage with 3rd party devices

Please note that while efforts are made to follow the PC/104 specification this peripheral is not tested with third party SBCs or connected peripherals. This card is not guaranteed to operate as intended when third party PC104 peripherals or SBCs are connected.