| Stargate Serial Configuration |
Last Modified: 2006-10-16
The Stargate processor board uses the PXA255 XScale processor by Intel which has 4 UART blocks for 4 distinct serial ports. The main serial port used as the Linux console which is located on the daughter card is mapped internally to /dev/ttyS0 on the Stargate board. While this serial port can be used for other things, doing so compromises the Linux console which means if you ever loose the other form (s) of connectivity you may be using such as wireless or wired ethernet, you have a lovely looking brick that is difficult to recover. This HOWTO shows how to use one of the other serial ports on the board for communicating with I/O controllers such as the BrainStem family of controllers. This allows the console serial port to remain unchanged offering a basic need of a Linux system for recover, bootloader access, and system logging to a terminal.
The BrainStem Moto 1.0 (left) and the Stargate wired together with a 3-wire serial connection on /dev/ttyS2. This Stargate now has 2-channel PID motion control through the Stem.
ttyS2 Electrical Interface
The Stargate board has a compact 51-pin Mote connector on the side where you can see the two XScale chips (CPU and PIO). This connector has a second serial port on pins 16 and 17. The pin numbering is a bit tricky on this tiny connector. Here is a basic diagram:
These pins provide a standard serial port on /dev/ttyS2 (or /dev/tts/2 with the newer dynamic dev filesystem) that can be used for general I/O purposes. These pins are CMOS Bidirectional, Hi-Z (high impedance). Since the Stargate external logic is 3.3 volts, these pins can interface directly with small microcontrollers like the PIC 18C252 used on the BrainStem GP 1.0 Module or the BrainStem Moto 1.0 Module. If you want to interface this to some other peripheral that has RS-232 voltage levels (-10 to 10 volts), you would need an level-shifting interface. This can be easily handled with a Serial Interface Connector if you have 5V power handy (like the power supply for the Stargate) or you can use a driver chip like the MAX3244 which is used on the Stargate's daughter card for /dev/ttyS0, the console.
Detailed description of wire between Stargate and BrainStem.
ttyS1 Electrical Interface
This interfaces to the pins on the (often) unused Bluetooth serial port pads on the side of the board where the daughter card docs. Like the port above, these pins are again 3.3V tolerant CMOS pins. The pins are mapped as follows:
These pins can be soldered to for the above connections. The standard kernel uses flow control (regardless of what you do with ioctl calls) which will make it look like the port cannot send data if you don't electrically connect this.
When just seeking TX and RX with no hardware flow control, you can ground the CTS pin to disable this kernel level configuration of this port. You could also mess with the kernel to make this change if you like.
Below is a drawing of where you can grab a ground connection (Pin 4) to ground the CTS line. This might be a bit safer with a resistor (1K will work) if you are concerned about the kernel changing this pin to an output (which would short to ground). We use a small wire for this and it hasn't caused problems here.... yet.
Details of the pinout for the Bluetooth pads
Photo of Bluetooth/BTUART Connection
The BrainStem aIO Library is open-source for Linux and it provides a handy IO Stream architecture for communicating across abstract streams. The serial port interaction is very easy with this library as it takes care of all the issues of serial port baud rate setting, flow-control, etc. We use this for the BrainStem interaction and there are also streams for TCP/IP sockets, buffers, and a compression filter (zlib) that all are interchangeable. You may want to use these libraries streams to communicate over your new-found serial ports.
Some things to keep in mind. These are raw serial ports with no flow-control (when disabled for ttyS1). You just have RX and TX lines. Your software will need to accomodate this and the peripheral you are plugging in must be able to work in this mode. Also, while TX and RX are part of the serial interface, you still need a common ground to get things working. The ground can be pulled from many places on the Stargate board, including the Mote connector itself.
Questions or issues on this interface are actively sought. We want this information to be as clear as possible. Please contact us with flames, suggestions, questions, and ideas and we will incorporate them into this HOWTO to make it as clear as possible.
| voice: 720-564-0373, email: email@example.com, address: 4822 Sterling Dr., Boulder CO, 80301-2350, privacy |
© Copyright 1994-2012 Acroname, Inc., Boulder, Colorado. All rights reserved.