Misplaced Pages

PreonVM

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these messages)
This article does not cite any sources. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "PreonVM" – news · newspapers · books · scholar · JSTOR (November 2019) (Learn how and when to remove this message)
The topic of this article may not meet Misplaced Pages's notability guidelines for products and services. Please help to demonstrate the notability of the topic by citing reliable secondary sources that are independent of the topic and provide significant coverage of it beyond a mere trivial mention. If notability cannot be shown, the article is likely to be merged, redirected, or deleted.
Find sources: "PreonVM" – news · newspapers · books · scholar · JSTOR (April 2021) (Learn how and when to remove this message)
(Learn how and when to remove this message)
PreonVM
Written inC, Java
PlatformARM Cortex-M
TypeJava virtual machine
LicenseProprietary software
WebsitePreonVM

PreonVM is an implementation of the Java virtual machine developed by Virtenio. The PreonVM was initially developed to run on the Atmel AVR ATmega256, but has been ported to ARM Cortex-M3 systems. Therefore the VM can run on a microcontroller with 8 kB RAM and 256 kB ROM at a minimum. The PreonVM requires no additional operating system and runs directly on the microcontroller.

Every class file of the application is transformed via a ClassLinker to strip all parts of class files that is not required. This makes it possible to reduce the class file size by about 80%, which is required for a small device. The ClassLinker builds a .vmm file which combines all application class files in a special format which can be read and executed by the PreonVM on the microcontroller.

The VM supports all Java data types incl. long and double, threads, synchronization, Garbage collection with memory defragmentation, exceptions, system properties and IRQ/event system. The PreonVM comes with a library of driver classes for IO like I2C, SPI, USART, CAN, PWM, IRQ, RTC, GPIO, ADC, DAC and with drivers for some sensors and IC's.

Code example

The following code examples uses an SHT21 sensor and reads the relative humidity.

public class SHT21Demo { 
    public static void main(String args) {
        // sensor is connected to I2C bus instance 1
        NativeI2C i2c = NativeI2C.getInstance(1);
        i2c.open();
        // create and init SHT21 sensor instance
        SHT21 sht21 = new SHT21(i2c);
        sht21.setResolution(SHT21.RESOLUTION_RH12_T14);
        sht21.reset();
        // read and print humidity every second
        while (true) {
            sht21.startRelativeHumidityConversion();
            Thread.sleep(100);
            int rawRH = sht21.getRelativeHumidityRaw();
            float rh = SHT21.convertRawRHToRHw(rawRH);
            System.out.println("SHT21: rawRH=" + rawRH + "; RH=" + rh);
            Thread.sleep(900);
        }
    } 
}

See also

External links

Java virtual machines (comparison)
Sun, Oracle
Major implementations
Embedded
Others
Discontinued


Stub icon

This software article is a stub. You can help Misplaced Pages by expanding it.

Categories: