Java virtual machine for the Atmel AVR ATmega8

Not rated 6,461

Circuit Image

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. Alternately, 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 upload 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. More: 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 will always be limited to a small subset of the java language and the standard java libraries and a few application specific methods. Furthermore, it is not meant to replace C as the standard way of programming microcontrollers. It is less flexible and has a lower performance than C or assembler programs. The NanoVM is a way to provide a limited but controllable programming interface to a microcontroller based device. With most of the most hardware specific code being part of the NanoVM itself, the user can focus on the application itself. If a user is given a device equipped with the NanoVM he is not required to think about the hardware itself. Furthermore, he doesn't need any target specific compilers or the like. All he needs is a standard java compiler and the NanoVMTool which itself is written in java. Thus, the whole development chain works on any device that has a java compiler and can run java code. With the hardware abstraction the NanoVM provides, the user doesn't even have to care about the microcontroller type the target is based on. The same java compiler and the same NanoVMTool can be used with any NanoVM based system running on any type of microontroller.

The NanoVM represents a compact implementation of a Java Virtual Machine tailored for the Atmel AVR ATmega8 microcontroller, primarily designed for use in applications such as the DLR Asuro robot. This implementation allows developers to write programs in Java, utilizing the well-known Sun JDK, while adhering to the constraints of the AVR architecture. The NanoVM is distributed under the GPL, promoting accessibility for hobbyists and developers interested in AVR-based systems.

The installation of the NanoVM requires replacing the original bootloader of the ATmega8. This process necessitates using a programming board, such as the STK-500, or a custom interface that allows in-circuit programming of the chip while it remains in the Asuro robot. The programming is accomplished using an AVR ISP cable connected to a PC, with software tools like Ponyprog or UISP facilitating the upload of the NanoVM and associated applications.

The NanoVM is designed to fit within the stringent memory limitations of the ATmega8, with the entire implementation, including a bootloader and native classes, fitting within 8 kBytes of flash memory. The system utilizes the full 512 Bytes of EEPROM for Java program storage, while 75% of the available 1 kByte RAM can be allocated for Java program execution. The NanoVM supports standard Java bytecode and is capable of executing approximately 20,000 Java opcodes per second at an 8 MHz clock speed.

Key features of the NanoVM include configurable integer arithmetic, optional floating-point support, garbage collection, and a unified stack and heap architecture. Native classes provided by the NanoVM facilitate essential operations such as object handling, input/output management, console output, string processing, and control of the Asuro robot. The NanoVM is not intended to be a comprehensive Java VM; instead, it offers a simplified programming interface that abstracts hardware complexities, allowing users to focus on application development without needing extensive knowledge of the underlying microcontroller architecture.

In summary, the NanoVM serves as a specialized tool for developers looking to leverage Java programming in microcontroller applications, particularly within the constraints of the AVR ATmega8, while providing a straightforward development environment that does not require extensive hardware-specific knowledge.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. 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 will always be limited to a small subset of the java language and the standard java libraries and a few application specific methods. Furthermore, it is not meant to replace C as the standard way of programming microcontrollers. It is less flexible and has a lower performance than C or assembler programs. The NanoVM is a way to provide a limited but controllable programming interface to a microcontroller based device.

With most of the most hardware specific code being part of the NanoVM itself, the user can focus on the application itself. If a user is given a device equipped with the NanoVM he is not required to think about the hardware itself.

Furthermore, he doesn't need any target specific compilers or the like. All he needs is a standard java compiler and the NanoVMTool which itself is written in java. Thus, the whole development chain works on any device that has a java compiler and can run java code. With the hardware abstraction the NanoVM provides, the user doesn't even have to care about the microcontroller type the target is based on.

The same java compiler and the same NanoVMTool can be used with any NanoVM based system running on any type of microontroller. 🔗 External reference




Warning: include(partials/cookie-banner.php): Failed to open stream: Permission denied in /var/www/html/nextgr/view-circuit.php on line 713

Warning: include(): Failed opening 'partials/cookie-banner.php' for inclusion (include_path='.:/usr/share/php') in /var/www/html/nextgr/view-circuit.php on line 713