I'm not really sure why you would want to create an NXT VM on an Arduino, but it would be nearly impossible as far as I know. NXT FW by itself takes about 128k of flash, and uses about 32k of RAM. Both those numbers are far outside what an AVR can provide.
If you want any chance at all to get it to work with an Arduino, wait for the Due to be released. It's supposed to have 256k flash, and 50k RAM (close to the NXT's 256k flash and 64k RAM).
However, I still think it's next to impossible to make it work.
Lego released many documents for the NXT, as well as the source-code of their FW, so obviously they expect people to use it other than in the way it was originally designed. If you are doing it just for the fun and learning process, I'm quite sure you will legally be fine.
I was proposing to build a scaled down version in terms of the memory requirements. I really wanted to create a byte-code interpreter that could accommodate a simple nxt program. That should be ok right?
NXT programs are extremely dependent on the FW layer. An Arduino also wouldn't have the HW resources that the NXT has. It would be next to impossible IMO.
I am curious though, what would be the point of such a project? The learning aspect?
ROBOTC uses a VM with similar functionality that works on many platforms, including the NXT and Arduino, so I am sure it can be done. Naturally, the Arduino port has fewer resources at its disposal but I am pretty sure the compiled code that runs on the VM is fairly similar to the one on the NXT.
- Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
NICE!! ROBOTC seems cool, always heard about it but never looked it up before.
The focus of my project is primarily academic, its a part of my research thesis in the aim of creating an extensible, modular, scalable, inexpensive robotics platform.
To get it done quickly and to get potential users utilizing it without a learning curve, I wanted to make it adaptable to those who are already doing robotics. (Focus on our local high school and college students)
So it would support LEGO NXT and all their programming tools. But that would just be a subset of its capability, for instance, the design I have already done for its architecture
allows support for hundreds of sensors and actuators, scaling far easier and less expensive than the LEGO system.
The choice of Arduino as a platform was also for the speed of initial implementation and hardware availability. The long term processor would perhaps be an AVR32 or even utilizing
arduino's potential ARM processor the Leonardo. I really wanted to start off a proof of concept with a LEGO bytecode interpreter that manages small programs.
Some guy managed to boot Linux on a 8-bit Atmel ATmega1284p microcontroller by writing his own ARM emulator to bypass the 32-bit requirement. It took 2 hours to boot to the terminal, but it worked...
On a more serious note, the executable file specification from Lego is what you want to use.