Problems Using NXTGCC

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
edisn
Posts: 20
Joined: 11 Feb 2011, 10:06

Problems Using NXTGCC

Post by edisn »

For a project i need to aquire as much of the Resources of the nxt as possible.
So i thought using Firmware level Programming would grant me the highest control of the resource usage.

But i have some huge problems geting sensor data (original ultrasonic sensor) or write motor outputs.
I think i missed some flags i should set or something like that.

Is ther someone who has already worked with NXTGCC,
or even has some demo Programms?
h-g-t
Posts: 552
Joined: 07 Jan 2011, 08:59
Location: Albania

Re: Problems Using NXTGCC

Post by h-g-t »

Had a quick look at the website - imho you would be better off with the BCC - http://bricxcc.sourceforge.net/
A sophistical rhetorician, inebriated with the exuberance of his own verbosity, and gifted with an egotistical imagination that can at all times command an interminable and inconsistent series of arguments to malign an opponent and to glorify himself.
edisn
Posts: 20
Joined: 11 Feb 2011, 10:06

Re: Problems Using NXTGCC

Post by edisn »

I am not sure if i could mace Mnimisation and opimisation with the bricx-software (Language: NXC).

I dont need the menu (or sound-files) and so, provided by the Firmware.
But i will need the maximum of the resources.
(So i dont want to use an Intepreter or such, my Programm schould runn native on the NXT.
But i dont now how an BricX programm is Executed.)

The Project i work on is dealing wirh AI, thats wy I need as much computation Power and Memory Space as possible.
h-g-t
Posts: 552
Joined: 07 Jan 2011, 08:59
Location: Albania

Re: Problems Using NXTGCC

Post by h-g-t »

If you look through this website you will find references to alternative firmwares from such as schodet and friends.

//sourceforge.net/apps/phpbb/mindboards/viewtopic.php?f=3&t=427

There is always pblua - http://www.hempeldesigngroup.com/lego/p ... /pbluagps/
A sophistical rhetorician, inebriated with the exuberance of his own verbosity, and gifted with an egotistical imagination that can at all times command an interminable and inconsistent series of arguments to malign an opponent and to glorify himself.
edisn
Posts: 20
Joined: 11 Feb 2011, 10:06

Re: Problems Using NXTGCC

Post by edisn »

As far as i now pblua is a verson of the lua language which is script bsed.
-> Uses Interpreter while running the programm -> Storas Script (big) and interprets online (slow)
(I may have the wrong idea about the lua project, but thats what i think about it.)
(-> Second: I hevent found anny source files, of pblua)

PS: Bevore i heve desided on NXTGCC i have loked on different sites like:
http://www.teamhassenplug.org/NXT/NXTSoftware.html
My decission for NXTGCC was based on the fact that it uses (or at least loks like it uses)
a cross compiler which produces code that can directly be executed on the microcontroler installed on the NXT.
-> This should be the fastest way to execute a programm.
h-g-t
Posts: 552
Joined: 07 Jan 2011, 08:59
Location: Albania

Re: Problems Using NXTGCC

Post by h-g-t »

I think this is the installation page for pblua but, as you say, it needs firmware to run it (the 'interpreter'). http://www.hempeldesigngroup.com/lego/p ... uainstall/

From having read the Mindboards site site, I know that there are users who have cut the firmware down to maximise the available memory.

I am no expert on the NXT but cannot recall seeing anyone running programs on the NXT without some form of firmware being present. No doubt I will be shot down very quickly by the experts here who know how to do it!
A sophistical rhetorician, inebriated with the exuberance of his own verbosity, and gifted with an egotistical imagination that can at all times command an interminable and inconsistent series of arguments to malign an opponent and to glorify himself.
edisn
Posts: 20
Joined: 11 Feb 2011, 10:06

Re: Problems Using NXTGCC

Post by edisn »

Do you maby now someone who (or a Project which) has alteres a firmware
(or written a own Firmware).

What i am doing in the NXTCGG is mor or less implanting the programm into the firmware, so that there is no need to
load a file (or interpret a file) on the NXT.

Maybe i schould start a new Thread on "how to write a nxt firmware?" or "How can i use Motors/Sensors in Firmware"
or something like that.
spillerrec
Posts: 358
Joined: 01 Oct 2010, 06:37
Location: Denmark
Contact:

Re: Problems Using NXTGCC

Post by spillerrec »

If you plan on making you own firmware just to run the program, you should be aware that there most likely is no simple way to read sensors or use the motors, you will have to reimplement all of it yourself.

You are probably looking for something like nxtOSEK. http://lejos-osek.sourceforge.net/whatislejososek.htm
The code runs natively on the NXT, ensuring the maximum execution speed. And there are ready-made functions for controlling motors and reading several sensors which, iirc, are not included in firmware but added directly to your program only when necessary to prevent having to store a large firmware with a lot of features you don't need anyway.
I haven't really used nxtOSEK though, so I'm no expert on the area...
If this is still not good enough then you are really going to try to push the limits of what is possible with the NXT brick...
My blog: http://spillerrec.dk/category/lego/
RICcreator, an alternative to nxtRICeditV2: http://riccreator.sourceforge.net/
edisn
Posts: 20
Joined: 11 Feb 2011, 10:06

Re: Problems Using NXTGCC

Post by edisn »

1) I have spoken with a professo of the Technical university (Graz),
and he mentioned that the AI would use much resources,
so i wont be capable of using all the posibilitys of the AI, but cut some of the posibilitys.
-> Thats wy i want to max the resources i could use for the AI.

2) I have seen that there aur projects like "Driver for ultrasonic sensor which works with multiplexer",
and the NXTGCC files (c_cmd.c) includes some testing files like "c_cmd_FB_LowSpeed_Continius.c" wich could be a ultrasonic sensor.
-> So there are people Using that level of programming.
-> NXTGCC includes some functions which could read sensor datas.
(I just have problems with the order i have to call them / Flags to be set.)

If someoe who writes NXT-Firmware or useng NXTGCC reads this,
pleas send me a reply a short code snipet or something like that.
(I have once worked on a CT'bot but i have no idea of the pherepherals used by the NXT)
schodet
Posts: 139
Joined: 29 Sep 2010, 11:21
Contact:

Re: Problems Using NXTGCC

Post by schodet »

The original NXT firmware, or NXTGCC is not really aimed at being used from C.

You should use something like:

- nxtOSEK, as spillerrec suggested,
- or NxOS,
- or Bare Metal on the NXT which is the simplest one, and provides drivers from NxOS.

Each one comes with the example you requested.

You could also use the NXT improved firmware but you will have the same problems than with NXTGCC.
LEGO things http://ni.fr.eu.org/lego/ - NXT Improved Firmware (GCC) http://nxt-firmware.ni.fr.eu.org/ - Other robots http://apbteam.org
Post Reply

Who is online

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