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:
- Download the JAR file below
- 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.
- Load the binary onto TINI via FTP - it is named Serial.tini
- Remove TILT400 JP6, the EN SER4 jumper in order to enable Serial 4.
- Telnet into TINI.
- 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).
- 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.
- 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.
- 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.
- You should also see a hello message on each connected terminal
- If you type characters on either connected terminal, they will be echoed back to
that terminal and also printed out on your Telnet connection.
|