TStik
App Note: Serial
TINI400 in the familiar
SIMM72 module
package

TStik is powered by Dallas Semiconductor TINI


Tstik Serial App Note


Serial0 and Serial4 Example program for TStik

serial0 and serial4 are currently supported as RS-232 serial ports on Tstik. TiniOS 1.12p9 or later is required for serial4 use. TStik version 2 and later now offer on-the-fly control of serial1 for either 1-Wire or asynchronous serial use.This gives you two UARTs (serial0 and serial4) plus 1-Wire, all active at the same time, or three UARTs (serial0, serial1, and serial4) all active at the same time.

Make sure to run the command 'stopserver -s' before running the example program to shut down Slush on serial0 so that the program can use it.

This is a simple echo program that will verify that user programs can use serial0 and serial4. When running from telnet, make sure to type 'stopserver -s' in at the Slush prompt to stop slush from using serial 0. The code is identical to javax.comm code on any other java platform, with the exception of the serial port identifier string. See the javadoc comments for more details.

To run this program on TStik in a TILT400.Pro socket board:

  1. Download the JAR file below
  2. Use the prebuilt binary for TINI 1.15, or rebuild using the Ant build file provided (change the Ant build parameters such as IP address to fit your PC network). We assume you have your Java Tools installed as we do.
  3. Load the binary onto TINI via FTP - it is named Serial.tini
  4. Remove TILT400 JP6, the EN SER4 jumper in order to enable Serial 4.
  5. Telnet into TINI.
  6. At a TINI Telnet slush prompt, type "downserver -s" so that the test program can access Serial 0 (by default slush assumes it has complete control over Serial 0).
  7. Connect a null modem cable between a DTE PC and Serial 4 on TILT400 (the top DB9 connector), or use a straight cable to a DCE serial device. Set that terminal for 115.2 kbaud.
  8. Connect a straight serial cable between a DTE PC and Serial 0 on TILT400 (the bottom DB9 connector), or use a null modem cable to a DCE serial device. Set that terminal for 115.2 kbaud.
  9. Run the binary from a slush prompt - "java Serial.tini &". You will see a startup message on your Telnet connection, describing the Serial example program.
  10. You should also see a hello message on each connected terminal
  11. If you type characters on either connected terminal, they will be echoed back to that terminal and also printed out on your Telnet connection.
TstikSerialExample including a binary for TINI 1.15. In it you will find all the sources, Ant build file, javadocs, and a TINI binary prebuilt.

TStik2 Serial Support

Serial1 mode on TStik2 can be controlled from the configuration register, on the fly. You can select either asynchronous serial use of the Serial1 UART, or use of serial1 with the DS2480B (built into TStik) for 1-Wire network access. This is especially useful if you have both serial and 1-Wire sensors which you would like to poll.

Note that TILT400 socket boards revision 2.X do not have RS232 level shifters for Serial1. A future TILT400 Revisioin 3 will add support for TStik2 new features. You can use all of TStik2's new features in your own socket board, of course.

 
Systronix® 939 Edison Street, Salt Lake City, Utah, USA 84111
contact us
 

Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.
Systronix is independent of Sun Microsystems, Inc.
TStik, JStik, JCX, JStamp, JSimm, JDroid, and JRealTime are trademarks of Systronix, Inc.
1-Wire, iButton and TINI are trademarks of Dallas Semiconductor
Simmstick is a trademark of Dontronics