NXT Bytecode interpreter for different hardware

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
Post Reply
frazras
Posts: 5
Joined: 11 Apr 2012, 14:43

NXT Bytecode interpreter for different hardware

Post by frazras »

Hi all,
I am working on a project to get the NXT bytecode running on a different hardware - Arduino to be exact.

    • How possible is that in the first place? Is the executable file specifications provided by LEGO my only resource (It seems a little complex)?
    • If no other resource is available will I need to use all the specifications it provides(memory map etc)?
    • Would I be infringing on any LEGO patent?
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: NXT Bytecode interpreter for different hardware

Post by mattallen37 »

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.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
frazras
Posts: 5
Joined: 11 Apr 2012, 14:43

Re: NXT Bytecode interpreter for different hardware

Post by frazras »

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?
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: NXT Bytecode interpreter for different hardware

Post by mattallen37 »

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?
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
mightor
Site Admin
Posts: 1079
Joined: 25 Sep 2010, 15:02
Location: Rotterdam, Netherlands
Contact:

Re: NXT Bytecode interpreter for different hardware

Post by mightor »

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)
frazras
Posts: 5
Joined: 11 Apr 2012, 14:43

Re: NXT Bytecode interpreter for different hardware

Post by frazras »

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.
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: NXT Bytecode interpreter for different hardware

Post by HaWe »

this project seems to be perfectly designed to make it by my favourite PL:
Image
;)
frazras
Posts: 5
Joined: 11 Apr 2012, 14:43

Re: NXT Bytecode interpreter for different hardware

Post by frazras »

LOL :lol: But is that a BAD thing?
spillerrec
Posts: 358
Joined: 01 Oct 2010, 06:37
Location: Denmark
Contact:

Re: NXT Bytecode interpreter for different hardware

Post by spillerrec »

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.
My blog: http://spillerrec.dk/category/lego/
RICcreator, an alternative to nxtRICeditV2: http://riccreator.sourceforge.net/
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 2 guests