Embedded Java: Down to the metal

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 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.

4 Responses to “Embedded Java: Down to the metal”

  1. arty caiado Says:

    I’ve got a TINI dev kit that I haven’t dug up for a couple years. I was thinking of ideas for a new project on it, and decided I’d like to create a temp/humidity sensor. Know of any ICs that’d do the job? Also, I’m definitely an amateur java guy, so any tutorials, etc. you could point me at to complete the job would be awesome. Anyway, cool blog and good write up.

  2. dbenn Says:

    Thanks Arty! Here’s a Maxim (Dallas Semiconductor) application note entitled “A 1-wire humidity sensor”: http://www.maxim-ic.com/appnotes.cfm/an_pk/758

    Given that it functions as a DS 1-wire device this might be suitable for your application. It uses two ICs: a DS2438 and a Honeywell HIH 3605. They take power from the data line (parasitic power). I have not actually used this circuit however.

    As far as Java tutorials are concerned, you could do a lot worse than to pick and choose the topics you need from Sun’s Java Tutorial, especially from the first 3 sections: http://java.sun.com/docs/books/tutorial/

    Since TINI implements a JVM 1.1.6 VM, newer features such as Regular Expressions and Generics can be ignored. To work with TINI you’ll mostly just want to know about the core features of the Java 1.1 language, along with Enumerations, Threads, Sockets (e.g. if you want to write a network-based server).

    If you want help with understanding any of the DS TINI code examples, or further advice, feel free to ask.

  3. nitlogic Says:

    Where can I read about pic16f84 microcontroller in your blog ?!

  4. dbenn Says:

    Hi nitlogic. I have written only one post specifically about PIC microcontrollers so far. It was the post before this one and the topic was my PIC C Library that is available on Sourceforge: http://dbenn.wordpress.com/2007/05/08/pic-c-library-on-sourceforge/

    The 16F84 is the part I originally wrote the PIC C Library for. I have used it for others however, including 12F675 and 16F684.

Leave a Reply


Discover more from Strange Quarks

Subscribe now to keep reading and get access to the full archive.

Continue reading