In September 2004 I gave a talk to the Adelaide Java User Group (http://ajug.org.au/display/AJUG/AjugAdlMeeting20040920) entitled Embedded Java: Down to the Metal at which I talked about:
- The Javelin Stamp, based upon a Ubicom microcontroller with just 32K RAM and EEPROM and pin-compatible with the older BASIC Stamp
- The Dallas Semiconductor TINI, an 8051-core device with ~1MB of Flash RAM
The TINI is Java 1.1.6 compatible with respect to the language and libraries, while the Javelin Stamp implements a smaller subset of Java with some deviations (e.g. ints are really shorts, no interfaces, no GC).
At that JUG meeting I demonstrated the Javelin Stamp displaying the temperature from a DS1620 IC on an array of 7-segment LEDs and dumping to System.out, which on the Stamp is a serial port.I mostly use the Javelin Stamp to prototype an application with unfamiliar hardware due to its easy serial-port based progamming and source-level debugging, and because I can write OO code for similar yet slightly different devices (e.g. for 7-segment LED displays that are direct pin to pin, via BCD-to-7-segment IC, or via serial-to-parallel-to-7-segment IC), varying driver code implementation while keeping the interface fixed. It also comes with a nice assortment of Java library code for exploiting the Stamp’s hardware features.
I wasn’t quite ready to demonstrate the DS TINI during the JUG meeting, but have experimented further since. The TINI, like the Javelin Stamp has serial I/O, but in addition, physical interfaces for Ethernet, CAN bus, I2C, DS 1-wire, and iButton. It comes with a similarly rich set of Java libraries (along with the many of the standard Java 1.1.6 libraries including collections and network I/O) for working with its capabilities.
Here’s a link to a simple PLT Scheme (http://www.plt-scheme.org/) servlet (currently unavailable, Jan 2008) that connects to a Java server running on a DS TINI in my home with a DS18S20 temperature IC connected to its 1-wire adapter:
http://www.kepler.podzone.net:8080/servlets/david/get_tini_temp.ss
The TINI is suitable for more ambitious yet relatively resource-low projects. If you want to see even more resource-constrained Java, check out JavaCard for smartcards. I worked on a team that developed a JavaCard VM for a smartcard development and test tool in the late ’90s.Here’s an embedded.com article about some alternatives to C for embedded system development: Java and Ada.
So folks, Java is not just for the desktop or web/Enterprise, but also for the embedded space.