A Few Final Thoughts
Recent advances in computers and networking technology have spurred tremendous interest in the development of computer-controlled devices, smart appliances, and so called web-enabled devices: electronic devices that communicate directly with the Internet. We hope this book has helped jump start you on the development of your own web-enabled devices using commercially available electronics.
Using a generic, Java-programmable network interface with a wide variety of inter- face busses, you can now make just about any device a network device. In this chapter we will briefly comment on the future of TINI and some of the many possi- bilities for connecting devices using TINI as the network controller.
The Future of TINI
During the early development of this book, Maxim Integrated Products Inc.1 pur- chased Dallas Semiconductor. Before this purchase, Dallas had big plans for future versions of TINI. All indications are that these plans will continue to develop into
new TINI products. Look for continued improvements to TINI in the coming months and years. By the time you read this book Dallas Semiconductor will have released the TINI software version 1.1, which will include several significant improvements.
• Dynamic class loading.
• Object serialization.
• Prioritized processes and threads.
• Stack traces.
• Support for mountable file systems.
Dallas Semiconductor has also announced2 and released a preliminary datasheet for the DS80C4003 Network Microcontroller that is expected to replace the 80C390 microcontroller on a future TINI version. The 80C400 will be an integrated CPU, 1- wire interface and 10/100 Ethernet interface. It will support the following features:
• Flat 16-MB address space.
• CAN 2.0B controller.
• Three full-duplex serial ports.
• Eight bidirectional 8-bit ports.
• Support for IPv4 and IPv6.
• Clock rates up to 50 MHz.
• 16 total interrupt sources with 6 external interrupts.
• Programmable IrDA clock.
• Advanced power management.
Dallas Semiconductor is clearly on the right road to reducing the chip count of the
TINI chipset for reduced cost, size and power on future versions of TINI.
Connecting Your Device
There are many visions of the networked future, with everything connected to and controllable through the Internet. Some fanciful visions include refrigerators that will track your home food inventory and automatically reorder your groceries as you consume them. Other visionaries dream of the days when all of your home appliances (like your dishwasher and clothes washer) will be networked and will automatically send email to the proper service technician when the appliance determines that it needs maintenance.
While these (and other visions) are certainly possible, the value of these services seems questionable, particularly after considering the added cost to add a network capability to a low-cost appliance and the added cost of providing a network connec- tion and the monthly monitoring service.
Why internet-enable anything?
While the need to network everything seems questionable, there is plenty of reason for connecting certain devices to either a LAN or the Internet. One of the more compelling reasons is that an embedded controller no longer needs a display or hardware user interface. A standard web browser can become the standard user interface (everyone has one of those, right?) for your device. The user requires no
new software to monitor and interact with your hardware and you can reduce the cost of your design by eliminating the need for user interface hardware (keyboard, display, etc). Another benefit is that the Internet provides a way for you to collect operational data about your device and learn how and when your customers use it and what features they use or don’t use. This also provides a way for you to add features or correct problems in the software remotely.
So, why use the Internet? Why not use one of the many other available network technologies? First and foremost, the Internet (and Ethernet) has become very common and so connectivity (routers, hubs, network interface cards, cables) is cheaper than with most proprietary communications schemes. Most office buildings have full network connectivity (even if it’s just a LAN) and many houses are now being fully wired for Ethernet. This existing network can now be the basis of home or office automation and monitoring tasks previously done with other wired networks. Worldwide connectivity via the Internet is everywhere (almost). By taking advantage of this, you can monitor and upgrade your devices over great distances almost as easily as if they were in the same room. The Internet also provides an easy means for distributing some of the processing load to other computers. By using a standard network and a TINI (which provides access to this network almost for free), you
might monitor a collection of weather or environmental sensors, for example, distrib- uted all over the world. While TINI is well suited for the task of monitoring sensors and reporting data over the network, a networked TINI could then retrieve additional weather-related information from publicly accessible weather servers. Additionally, data that may be too computationally intensive, such as the time of sunrise or the phase of the moon, could be calculated and retrieved from a computer on the network that is more suited to the task.
Throughout this book we have discussed and demonstrated the many interfaces available to you for controlling hardware and reading sensors—from I2C, CAN, 1- Wire, parallel IO, and serial ports.
We have also discussed and demonstrated the many ways TINI offers to connect to your LAN and the Internet: 10 base-T, RS-232 serial connection, and PPP connections.
Figure 14-2: TINI network connections
Using TINI as the base of your next embedded hardware design provides you with all of the tools to network enable just about anything (sensible or not). Here are just of few of the limitless possibilities of devices you can embed with TINI to make a remote networked device:
• Instrumentation and laboratory processes.
• Remote monitoring of manufacturing facilities, office buildings.
• Home or office alarm systems.
• Monitoring of distributed events (weather stations, remote seismic stations, environmental monitoring).
• Even networking your coffee pot (as silly as this may seem at first, this is little more than a scaled-back implementation of remote monitoring and control of things like manufacturing processes).
Figure 14-3: TINI networked coffee pot
What’s Been Done with TINI
A number of talented developers have produced a very interesting and varied array of applications using TINI. Here is a sampling of some of the hardware and software development using TINI.
TINI Ethernet MP3 Player4
The MP3elf is an Ethernet-connected MP3 player that receives an MP3 stream from a local area network server and delivers it to amplified speakers or a hi-fi system. The MP3elf hardware is based on the STA013 MP3 decoder chip (from STMicroelectronics) and a TINI single-board Java computer.
TINI CAN Monitor5
TINI is used in a prototype system that is able to establish an on-line connection between agricultural equipment with CAN sensors (that senses monitor equipment operating conditions) and a TCP/IP-based network for data analysis.
Servertec Web Server for TINI6
The Servertec Internet Server is a Web Server designed to run on TINI. Using this server, developers can easily create web-based applications that interact with a wide range of devices to control lighting, heating/cooling units, door entry, refrigeration, medical testers, monetary transactions, appliances and vending machines.
X10 Libraries for TINI7
Jesse Peterson has developed a Java library that can control both the CM11A and CM17A X10 controllers. This allows you to control X10-enabled devices from Java programs running on TINI.
TINI WAP Server8
The lightweight server allows any WAP-enabled PDA or cell phone to be served with WML and WMLScript based applications from a TINI embedded device. This server includes full image support to send WBMP and PNG graphics to the wireless browser.
TINI Beer Keg9
The device demonstrates the use of TINI for remote monitoring the status of an office beer keg (temperature and volume remaining).
TINI Drink machine10
TINI monitors the drink machine in the Rochester Institute of Technology Computer Science building. This uses 1-Wire devices that include switches and a temperature sensor for each slot.
TINI is the heart of a true Internet appliance, a toaster that collects weather forecasts and burns that forecast onto a piece of bread.
* * * * * * * * * * * * * * *
In the early 90s, when most people were just becoming aware of the Internet, there were a few university labs experimenting with connecting hardware to the Internet. The webcam was born. Nowadays, just about everybody has an Internet connection at home, and at work, our photocopiers, laser printers, and lab instruments are all IP addressable on a LAN. Web browsers are an integral part of how we access information. Do you have some project idea that you would like to put on the
Internet? Are you ready to build the better Internet mousetrap? We hope this book will give you a good start, by introducing how to build Internet-enabled devices via an inexpensive, ready-made, Java-powered microcontroller.
1. Warren Webb,
Ethernet Invades Embedded Space, EDN, September 11, 1998, pg 71-80
2. Warren Webb,
Embed The Web for Fun and Profit, EDN, March 18, 1999, pg 57-68
3. Warren Webb,
Designing Web Appliances on a Shoestring, EDN, April 13, 2000, pg 89-96
4. NS Manju Nath,
Low-Cost Techniques bring Internet Connectivity to Embedded Devices, EDN, November 11, 1999, pg 159-166
5. Dan Strassberg,
EDN, September 2, 1999, 101-108
6. Richard A Quinnell,
Web Servers in Embedded Systems Enhance User Interaction, EDN, April 10, 1997
7. Nicholas Cravotta,
Managing Internet Enabled Devices,
EDN, September 20, 1001, pg 48-60
8. Bill Travis,
Sensors Smarten Up,
EDN, March 8, 1999, pg 76-86.
10/100 BASE-T, 6 cable, 11-13
CLASSPATH, 117-119 libraries, 117-126 hardware, 119-120 program, 120-126 defined, 345
devices, 369-370 bus protocol, 349 reset, 350
communication details, 350-353 bus commands, 353-359 connecting PC to, 370-379
how TINI communicates with, 418-431 finding all devices, 400
memory mapped driver, 441
1-Wire Java API, 380-393
1-Wire Net, 102, 345-431
address, Ethernet, 13-14
address decoder (on TINI), 256-259 address space, (see TINI, address space) address, Internet, 14
API, 25, 185-190
AT commands, 524
authentication, user with PPP server, 554-561
BAT files (for compiling), 232-234 binding
To port number, 59 bridge, 8
broadband connection, 8, 9
buttons, adding to TINI, 273-280
ByteUtils.java listing, B-1 – B-10 (on CD-ROM)
cable categories, 11 cabling,
serial, 105-106, 112 network, 11-13
How TINI does, 163, 483-500
Bit timing, 478, 488
Bus monitor, 490-500
Physical Layer, 481
CAN interface, 158
CAT-3 cable, 11
CAT-5 cable, 11
CE0-3 signal name, 131
Class A, 14-15
Class B, 15
Class D, 14
Class E, 14 classes
Network, 14 classful routing, 14
CLASSPATH, 32, 35, 85, 107-108, 109,
client/server relationship, 20-21 connecting to Internet, 8-10 connection, dial-up, 9 constructor, 37
Controller Area Network (see CAN bus) CPURST signal name, 130, 131, 136,
CTX signal name, 131, 440, 485
CRX signal name, 131, 440, 485 crossover cable, 6, 12, 524
Controller Area Network
(see CAN bus)
D9, connector, 302
D25, connector, 302 data bus buffer, 255
data communication equipment, (DCE),
data terminal equipment, (DTE), 300
domain names, 14
DOS batch files, 232
DOS command window, 236
DS1315 real time clock, 151-152
DS1820 1-Wire thermometer, 500
DS1920 thermometer, 366-369, 411-418,
DS2401 silicon serial number, 120, 501
DS2405 addressable switch, 362-365,
DS2406 1-Wire switch, 500
DS2480, 149-150, 375
DS80C390, 127, 133
DTR232 signal name, 131. 150-151,
E10/E20 socket board, 158-172
EN2480 signal name, 131. 149-150 encapsulation, 18
error handling, 52-54
Ethernet, 5, 514-518
Controller (on TINI), 156
Example programs, BitPortTest.java, 148
HelloWorld.java, 27, 114
MyKeypad.java, 284 pollButton.java, 279 pollKeypad.java, 283
SerialLoopTest.java, 86, 314
WatchDogDemo.java, 137 exception handling, 51-58
EXTINT signal name, 131, 168, 273,
flash ROM, 141-142
Finally keyword, 58
hardware, network, 5
HTTP server, 60-73 hub, 7, 8
HyperTerminal, 180-181, 525
I2C, 157, 433-466
Data format, 435-439
How TINI does, 157, 440
Master/slave concept in, 434
Memory-mapped driver for, 441
TINI software for, 442 iButton, 149, 348, 430 inheritance, 41-51 instance, 37
interface (in Java), 82
Internet address, 14
Internet connectivity, rationale behind,
Internet Protocol, 14, 511
Interrupt selection circuitry, 168
INTOW signal name, 131, 147-149,
I/O circuits, C-1 (on CD-ROM) IP address, 14, 516
IP network, 511
Ipconfig, slush command, 511-514
Java Development Kit, 25-30
Java Runtime Environment, 25
Java, 25, 37-59
Methods, 206 references, 4
loading and running, 109 loading firmware with, 113 description, 177-179
DTR error, 184 javax.comm., 30-36
JDK (see Java Development Kit) Jedit, 240-241
JRE (see Java Runtime Environment)
keypad, adding to TINI, 280-286
LAN (see Local Area Network)
LCD display, adding to TINI, 260-272
LED display, adding to TINI, 286-294
LED status lights on TINI, 157 local area network, 5, 6
MAC address, 13-14
makefiles (for compiling), 238-240
MAN (see Metropolitan Area Network) memory map, (see TINI, memory map) memory mapped devices, 255-260 method, defined, 37
metropolitan area network, 5
microcontrollers, (see network-enabled microcontrollers)
MicroLAN (see 1-Wire Net)
minicom, using, 180-181
Modem class, 528 testing, 535-537
modem connection, 528
network address, 7, 13-17 network classes, 14-15
network communication, 17-21 network devices, 93
network hardware, 5 network hub, 7
network interface card, 6, 9 network programming, 59
network-enabled microcontrollers, table of,
NIC (see network interface card)
object-oriented programming, 39-40
One-Wire (see 1-Wire) OOP diagrams, 39-40
Open Systems Interconnection, 18
OWIO signal name, 131, 149-150, 419
package diagrams for TINI API, 185-190 parallel communication software, 334-337 parallel device example, 337-344
parallel ports, 331-344
PCE0-3 signal name, 131, 257
PCF8574 remote 8-bit I/O expander, 455 pinout, TINI, A-6 – A-7 (on CD-ROM) point-to-point protocol, 9
port adapter, 381-396 port (TCP/IP), 21
assignments, 22 ports (CPU), 134-136 power supply, on TINI, 164
TINI as client, 538
TINI as server, 545
ppp command in slush, 561-566
PPP connection, 9, 518-520 physical interface, 523
PPPCommand class, 561
PPPEvents, 520, 521
PPPServer class, 548 prerequisites, 4 protocol stack, 18 protocols, 18-19, 21
Real time clock, 151-152
real-time clock demo program, 153 repeater, 8
RJ-11 cable, 12
RJ-45 connector, 11, 162, 304 router, 8
RS232 interface (also see “serial port” and
“TINI, serial port”, 150, 295
RX232 signal name, 131, 150-151, 307 rxtx, 35
SAA1064 LED display driver, 447
SCL signal name, 440
SDA signal name, 440
SDK (see Software Development Kit)
serial cables/connectors, 300-305
serial communication software (API), 311 serial line voltages, 298-299
baud rate divisor, 330-331 cable wiring, 303 connector pinout, 302 general, 295
java access, 30-36 loopback test, 85-91 on PC, 85-91,
TINI (serial0-3), 295-331 serial server, TINI, 204, 308 server, 21
reading/writing to, 63, 67 silver satin, 11
slush, 113, 190, 204
Adding commands, 226-232 commands, 193-199
files and environment, 199-204 modifying, 219-232 recompiling, 219-223, 561 starting, 191-193
SMTP, 20 socket, 21
reading/writing to, 60 socket board, E10/E20,
CAN interface, 163
DTR reset enable, 160-161 ethernet interface, 162-163 external 1-Wire interface, 162
external interrupt selection circuitry,
flash, additional, 164-166 flash, over ride, 166
internal 1-Wire interface, 169
LCD interface, 172 parallel IO, 169-172 regulated power supply, 164 serial2, serial3, 167-168 serial interface, 160-161
socket boards, other
Vinculum Technologies, 173
making your own, 175
Software Development Kit, 25 subclass, Java, 42
subnetwork, 16-17 superclass, Java, 42 switch, 8
Systronix, 174, 254
TCP/IP, 9, 17-18, 516 layers, 19
protocol stack, 59
terminal connection, 180
Thermochron, 349 threads, 74-84, 205 throwing, exception, 52
120-volt AC sensor for, C-4 (on CD-ROM)
120 VAC switching for, C-8 (on CD-ROM)
Flash memory to, 251
LCD display, 260
LED display, 286-294 memory, 245-251
memory-mapped devices, 255
SIMM connector, 253-254 address space, 139-140
address decoder, 256-260
API, 185, 421-425
CAN (controller area network), 163,
components, 130, A-1 (on CD-ROM) CPU pinout, 133-136
CPU Reset, 146
datasheets, A-5 (on CD-ROM) external 1-Wire bus, 419 external 1-Wire I/O, 149 external interrupt, 168 firmware, 182-185
flash ROM, 141-143 flash override, 166 future of, 569-570
general specifications, 101, 127-130 hardware, 127-176
internal 1-Wire bus, 147, 420
I2C interface, 157-158, 440
LED status lights, 157
LED indicator, C-5 (on CD-ROM)
libraries, 107-109 loader, 180-182 memory map, 140 memory, 205
network, 514, 518, 572 networking classes, 518 nonvolatile RAM, 144
optically isolated voltage input, C-2 (on CD-ROM)
optically isolated output, C-8 (on CD-ROM)
parallel ports, 169-172, 332-333 pinout, A-6 – A-7 (on CD-ROM) port adapter objects, 420 position sensing circuit, C-3 power supply, 164
programming, 114, 204-232
RAM nonvolatizer, 144 real-time clock, 151
relay control, C-6 (on CD-ROM)
serial ports, 150-151, 305-311
SIMM, 102, 130-132
socket accessories, 173-175 socket boards, 103-105
solid-state relay, C-7 (on CD-ROM)
static RAM, 143-144 stick, 129-130
switch input, C-1 (on CD-ROM)
third-party software, 241-243
versions, 128 A-1 (on CD-ROM)
watchdog timer, 137
TINI microcontroller board, 98
twisted pair cable, 11
TX232 signal name, 131, 150-151, 307
UDP, 19 uplink port, 7
objects, 73 class, 73
user authentication, 554-561 utilities, 232-237
Vinculum Technologies, 173, 254
WAN (see Wide area network)
watchdog timer, 137
Web server, java, 60-73, 211-218
Wired AND, 1-wire, 347 wide area network, 5