Академический Документы
Профессиональный Документы
Культура Документы
com/print/51717
BLOG Electronics
A lot of users have experiences of using a virtual machine. These VMs are quite useful for
developers who have to work on multiple OS platforms. There are many VMs running on
embedded microcontrollers, too. These embedded VMs are dedicated for a specific purpose.
A lot of embedded applications leverage them to reduce system complexity, memory
footprint, and deploy the custom design quickly. It sounds incorrect, since running VM
requires extra resources of embedded microcontroller, and demands extra programming
skills, either. However embedded VM indeed can help developers to achieve those goals.
projects. Because I found that all the custom contents, not only the HTML pages, but also the
CGI scripts, are stored in the EEPROM and running on a VM. Before I knew it, I used to think
each embedded server should be programmed individually for its own task, and the code and
content had to be reprogrammed as soon as the requirement changed. Thanks to the VM
technology, the HTML/CGI can be stored in internal or external EEPROM; the firmware in
microcontroller is identical for all embedded servers. This approach dramatically reduces the
custom change requirement, code size and simplifies the runtime program structure,
compared to the native code..
Pcode, as the VM of PicoWeb, is a binary VM. The concept is as same as Java. A developer
can write the code with Pcode pseudo code, compile it into final binary Pcode. Then the
binary Pcode is downloaded to EEPROM, a Pcode VM interpreter will read the Pcode in the
EEPROM and run it. Of course you can argue with me that VM approach will bring more
complexity for extra VM runtime and complier support. Yes, indeed. But it is worthy. Let us
browse the Pcode instructions, you will find a lot of regular low-level instructions (i.e. MOV,
XOR, OR, NOT, CLR and JMP) as well as some high level application-specific instructions.
Since Pcode is designed for an embedded server, it has following application-specific high
level instructions:
Then we can conclude how and why this approach reduces the system software complexity
and reduce the code size. Inside the microcontroller, we can only put a real-time kernel,
drivers, and a Pcode runtime engine. A lot of application specific native codes are abstracted
and re-programmed in Pcode instructions, which are stored in external EEPROM.
Additionally, the developer can even hide its core competency inside the microcontroller with
the approach, while offers change flexibility in external EEPROM as well. For more
information about PicoWeb, please visit www.picoweb.com [3]. Some other electronics
designs can benefit from this idea, such as UI custom design, PLC, and any applications
need custom design.
Of course, there are many similar projects, either legacy or state-of-art technologies.
Sun's JavaCard, Java VM runtime, custom applications are written in Java, downloaded
and running on Smartcards. Embedded Java is a hot topic as well. You can easily find
open source projects for Java.http://java.sun.com/products/javacard/ [4]
Intel's BASIC interpreter. The project is quite old, but I still keep the code. If any
developer is interested in it, he has to port it to existing platform, since the original
version was designed for running in an external SRAM. And developer must understand
8051 assembly code very well, because all of the codes are developed by 8051
assembly. Intel's approach is different from PicoWeb’s, the user BASIC code must be in
the form of source code, the BASIC VM parses the source code and starts to interpret
and run.
BASIC Stamp from Parallax, a commercial BASIC interpreter for educational, robotics.
http://www.parallax.com/ [5]
nesC of TinyOS, an alternative runtime for sensor networking. http://www.tinyos.net/ [6]
Trademarks
Links:
[1] http://www.picoweb.net/
[2] http://www.picoweb.net/download/pw1_pcode.pdf
[3] http://www.picoweb.com
[4] http://java.sun.com/products/javacard/
[5] http://www.parallax.com/
[6] http://www.tinyos.net/