TStik
App Note: 1-Wire™
TINI400 in the familiar
SIMM72 module
package

TStik is powered by Dallas Semiconductor TINI


This app note will both introduce Tini dependancies and demonstrate their use in a one wire example.

Required Files:
One_Wire.zip

Example code for this App note. Includes the Systronix dependancies file. This file is used to define TStik specific modules, such as SPI. It also includes some helpful shortcuts for the one wire containers.

Tested for TiniOS 1.12, must be re-built. A build.xml Tini Ant script is included to help you build for your TiniOS version.

Tini SDK You will need the ability to compile Java code and build Tini executables. Please include the version number of your TiniOS with any support questions.

Example 1-Wire Devices


This program enumerates all the adapters and devices connected to a TStik just like the ListOW program. The main difference is that it also uses those devices to do useful things. The three devices connected to a TStik and Tilt.400 socket board are:

  • A read-only mac address part used to provide a physical address to TStik.
  • A DS2433 eeprom that can be used for both netboot and other functions
  • A DS1920 temperature sensor used to measure temperature

The mac address part can be read, but should not be written under any circumstances. Unpredicatable behavior may result.

The DS2433 eeprom demonstrates that all devices on a 1-Wire net with general purpose memory banks can be read and written without including the container in the code. This way, 1-Wire devices can be changed without changing any of the code that reads them. You still must include the device family 0x23 dependancy in the build file. This example uses a PagedMemoryBank to write data with a length byte and CRC the way many Dallas programs use to validate data from 1-Wire devices. This API is optional for general purpose data, but is required for creating a netboot 1-Wire device and other applications.

The DS1920 temperature sensor is enabled by installing JP12 on your TILT 400 pro board. The use of this temperature sensor is demonstrated in the code and is written in such a way that any temperature sensor can be used with the same code base. Once again, you must include device family 0x10 dependancy in your build file.


Example Program

This app note will introduce you to 1-Wire dependancies. Dependancies can also be used for non-1-Wire classes, but are pre-defined in the Tini SDK for the Dallas 1-Wire API. The included build.xml file uses the %TINI_HOME% variable along with the /bin/owapi_dep.txt, and /bin/owapi_dependencies_TINI.jar files included in the Tini SDK to provide a way to build in only the class files needed to run the DS1920 and DS2433 1-Wire devices in this app note.

In general, to use 1-Wire you will need to add the containers for your device to the dependancy list as is demonstrated in the build.xml file. These dependancies depend on other dependancies in the file to ensure all the classes you need will be included. If you also have user dependancies, you must append your dependancies to the Dallas dependancy file. It is usually helpful to make a copy for each project so that each Tini project you write do not interfere with each other.

In conclusion, this app note demonstrates how to use the standard 1-Wire dependancies provided by Dallas to build a simple 1-Wire program based on the Dallas ListOW example. It also gives some particular examples of how to access the memory of a DS2433 and the temperature reading of a DS1920.

 
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