Accessing MTCDP Hardware Interfaces
Cellular Modem
Ports per model:
MTCDP-E1: /dev/ttyS1
MTCDP-G2: /dev/ttyS1
MTCDP-EV2: /dev/ttyUSB0
MTCDP-H4: /dev/ttyUSB3, /dev/ttyUSB4
The internal cellular modem is accessible using the correct port for your model above.
The MTCDP-H4 modem has two device ports for serial communication: /dev/ttyUSB3 accepts all supported AT commands, while /dev/ttyUSB4 is intended for initiating data connections and only supports a limited set of AT commands. Having multiple serial ports enables the developer to access extra information, such as signal strength (AT+CSQ), while the device is online.
Note: The comments in the default /etc/ppp/options file distributed with the CDP show to use /dev/ttyUSB3. This is fully supported and functional, but if access to the full AT command set is needed while a ppp link is active, the developer can initiate a ppp link on /dev/ttyUSB4 instead, leaving /dev/ttyUSB3 available for full AT command support.
To test AT commands, CoreCDP sample images provide both microcom and minicom for serial communication.
To establish a PPP link for internet access, make sure the correct device port is set in /etc/ppp/options. Once pppd is configured for your device, it is recommended to create a pppd chat script in /etc/ppp/peers that is specific to your wireless carrier. Then run pppd call <script name> to initiate the connection. See PPP Peers for more information.
The reset line on the modem can be controlled using the mts-io module. See I/O Control using mts-io Package
External 9-pin RS232 Serial Port
Port: /dev/ttyS2
The external 9-pin serial port is accessible using /dev/ttyS2. To control the DSR, RI, and DCD pins, see I/O Control using mts-io Package
GPS Reciever
Port: /dev/ttyS3
Baudrate: 9600
The GPS receiver is accessible at 9600 baud on /dev/ttyS3. See GPS Receiver Overview for more receiver and protocol information. Also see Command-line Utility for GPS for configuring the receiver if needed. Note that no configuration is needed to simply read location data — the receiver writes location updates at 1 second intervals by default.
USB Device Port
Port: /dev/ttyGS0
Driver: g_serial
The USB device port is configured by default to operate as a serial device using the USB Gadget serial driver. The CoreCDP sample images have the port configured as a login port. In some cases the USB cable must be attached to your PC when the device boots up to be accessible.
The gadget serial device provides a CDC-ACM serial device which is autodetected by most Linux systems and no driver install should be necessary. For Windows systems, first read the instructions in the gadget serial documentation and then download linux-cdc-acm.inf, which is located in the kernel usb documentation directory.
Ethernet
The 10/100 Ethernet interface can be configured by editing /etc/network/interfaces (a Debian-style network configuration file). The CoreCDP sample images set a default static IP address of 192.168.2.1. To use DHCP, change the iface eth0 inet static line to iface eth0 inet dhcp and remove or comment out the address, netmask, and gateway lines for eth0.
The Ethernet port can also be disabled using the mts-io module, if needed. See I/O Control using mts-io Package
SD Card Slot
Device: /dev/mmcblk0p1 (first partition)
SD card access is available via a block device at /dev/mmcblk0pX, where X is the partition number on the card. The CoreCDP sample images are configured to auto-mount /dev/mmcblk0p1 at /media/card both on boot and on card insert. By default, the card is mounted with the “sync” option on — this causes writes to be flushed to the card immediately.
LEDs
There are five programmable LEDs on the MTCDP hardware. By default, LEDs B-E are accessible through sysfs using the mts-io driver. LED A (status LED) is accessible through sysfs using the built-in leds-gpio kernel driver. LED A defaults to being a status light and is blinked by the “heartbeat” trigger on kernel boot. See I/O Control using mts-io Package for more information.
Example of controlling LED A via leds-gpio:
$ cd /sys/class/leds/status/ $ ls brightness device power subsystem trigger uevent # current trigger is in square brackets $ cat trigger none nand-disk mmc0 timer [heartbeat] default-on # disable heartbeat trigger $ echo "none" > trigger # turn LED on $ echo 1 > brightness # make the LED blink on SD card activity $ echo "mmc0" > trigger # blink on NAND Flash activity $ echo "nand-disk" > trigger # Use the "timer" trigger to blink the LED $ echo "timer" > trigger # Keep it on for 1000 ms and off for 500 ms $ echo 1000 > delay_on $ echo 500 > delay_off
Temperature Sensor
The temperature sensor is located on the bottom of the MTCDP board and can be used for monitoring the board temperature. The temperature sensor can be read using the mts-io module. See I/O Control using mts-io Package for details and examples.
Reset Button
The reset button on the back panel of the MTCDP can be read using the mts-io module. The mts-io module also provides the ability to send a signal to a specified process when the button is pressed. This allows your application to be notified when the button is pressed so it can take the appropriate action. See I/O Control using mts-io Package for more information.
The following interfaces are available on R1.0 hardware
USB 2.0 Full Speed (12 Mbps) Host
The USB Host is supported driectly by the Linux kernel. Drivers for many devices are available. Only certain devices are active in the baseline corecdp firmware.
External Digital Inputs 0-7
The eight external digital inputs can be read using the mts-io module. See I/O Control using mts-io Package for more information. See the GPIO Interface Electrical Requirements page for more information on the electrical characteristics of the inputs.
External Digital Outputs 0-7
The eight external digital outputs can be set using the mts-io module. See I/O Control using mts-io Package for more information. See the GPIO Interface Electrical Requirements page for more information on the electrical characteristics of the outputs.
Analog Input Channels 0-3
The four analog input channels can be read using the mts-io module. See I/O Control using mts-io Package for more information. See the GPIO Interface Electrical Requirements page for more information on the electrical characteristics of the inputs.
External SPI Bus
The External SPI bus can be used to access up to 2 SPI devices. Support for devices is through the SPI driver native to the corecdp firmware, usually found in the Linux Kernel’s source code in the <Linux_source_dir>/Documentation/spi directory. See the GPIO Interface Electrical Requirements page for more information on the electrical characteristics of the SPI bus.
External I2C Bus
The External I2C bus can be used to access I2C devices. Support for devices is through the I2C driver native to the corecdp firmware, usually found in the Linux Kernel’s source code in the <Linux_source_dir>/Documentation/i2c directory. See the GPIO Interface Electrical Requirements page for more information on the electrical characteristics of the I2C bus.
External Debug Serial Port
The External Debug Serial port is an alternate way to connect to the dedicated serial port used by the corecdp firmware to monitor errors and debug messages. See Serial Debug Cable Diagram for pin out.
GPS Pulse Per Second (PPS) Output
The GPS PPS signal is generated by the GPS receiver when it has a lock. This signal is only available on GP versions of the MTCDP hardware. See the GPIO Interface Electrical Requirements page for more information on the electrical characteristics of the output.