Java virtual machine for the Atmel AVR ATmega8

Posted on Feb 20, 2013

The NanoVM is a java virtual machine for the Atmel AVR ATmega8 CPU, the member of the AVR CPU family used e.g. in the DLR Asuro robot, manufactured by AREXX engineering. With the NanoVM, the Asuro can be programmed in the popular Java language using the standard Sun JDK. The NanoVM and its tools are distributed under the GPL and can be used on other AVR based systems as well. Some AVRs like e.g. the ATmega8 that comes with the Asuro are delivered preprogrammed to the user. The pre-installed bootloader allows the user to upload further code onto the CPU. The Asuro e.g. comes with a bootloader that allows to upload code via the IR transmitter delivered with the Asuro. The NanoVM cannot be installed using this mechanism, since the bootloader itself has to be replaced as well. Instead the complete contents of the AVR CPU including the bootloader have to be replaced. This requires the CPU to be placed in some programming board like e.g. the STK-500. Alternally, a simple interface (photo of installed interface) allows you to reprogram the entire chip while its still placed in the Asuro. In both cases the connection to the PC is done via a special AVR ISP programming cable (see e.g. these DIY instructions if you want to build one yourself) connected to a PCs printerport. The NanoVM itself is then being uploaded onto the chip using a software like Ponyprog or UISP. Since there's currently no way of making a backup of or to restore the original bootloader in the ATmega8 shipped with the Asuro it is strongly recommended to use a seperate ATmega8 CPU for the NanoVM. New unprogrammed AVR ATmega8 CPUs are cheap! The NanoVM itself contains its own bootloader. Once it is installed in the target system like e.g. the Asuro it can use the IR interface to install Java client programs. A special NanoVM tool (formerly Convert tool) is available for the NanoVM to uplaod Java programs to the Asuro. The NanoVM for Asuro replaces the original firmware of the Asuro with a Java virtual machine capable of running a subset of the virtual machine command set. This enables e.g. the Asuro to interpret java bytecode and to run simple java programs like e.g. this one.

Java virtual machine for the Atmel AVR ATmega8
Click here to download the full size of the above Circuit.

The NanoVM is a very resource aware implementation of the java vm. The Asuro version including a boot loader and several native classes fit into the 8kBytes flash rom of the Asuros AVR ATmega8 CPU. The complete 512 Byte EEPROM space of the CPU are available as Java program space and 75% of the 1 kByte RAM space are available to the running Java program. The current version of the NanoVM for Asuro includes: Support for standard java bytecode Tested on AVR Mega8 and Mega32 Configurable 15/31 bit integer arithmetic Optional float support Garbage collection Bootloader for simple application upload Tested with Suns JDK and IBMs jikes Supports inheritance Unified stack and heap architecture Requires less than 8kBytes of code memory at least 512 Bytes code storage for java byte code (e.g. the complete 512 eeprom bytes available on the AVR ATmega8 CPU) at least 768 Bytes application RAM available (of 1k total RAM available on the AVR ATmega8 CPU) About 20k Java opcodes per second on 8 Mhz AVR Native classes include: java/lang/Object (object handling) java/lang/System (IO handling) java/io/PrintStream (console output) java/lang/StringBuffer (string processing) asuro (asuro control) Native support for LCDs, AVR io etc What the NanoVM is and what it isn't There seems to be some confusion about what the NanoVM is and can do and what it can't and isn't. It is not a full featured Java VM and it will never be. It...

Leave Comment

characters left:

New Circuits



Popular Circuits

All-analog automatic night light circuit
zener Flyback diodes issues and pull-in & hold current issues in this Relay circuit
Light circuit diagram: Intelligent Electronic Lock
potential difference between point x and point y
Isolated Fuse Fail Indicator
Astable Multivibrator Calculations
Compact High-Performance 12V 20W Stereo Amplifier
Electric oven circuit
PT2102 dimming control ASIC
Adjustable output voltage regulator type rectifier circuit times