NXT-G, NXC, I2C..What to use to make fastest operations?
-
- Posts: 26
- Joined: 04 Dec 2011, 12:12
Re: NXT-G, NXC, I2C..What to use to make fastest operations?
It's white and black but it looks orange cause of light. Well it's only lego bricks, nothing much. Inside there is two old style rotation sensors and the 6,35mm jack output.
Re: NXT-G, NXC, I2C..What to use to make fastest operations?
You schold check out this post for actual performance figures for I2C operations. Make sure to read the whole post as Improvements were made to NXC during the active life of this thread. Basicly RobotC, NXC and robotC are about 10 times faster than NXT-G.
I think the question is whether to invest in learning one of the above languages. In the end the investment will pay off for a project like this. Lejos will be hardest to learn but offers a nice collection of sound related functions. RobotC and NXC have equal learning curves but the support for NXC is better.
It took me about one month to get to grips with robotC and three month to get used to Lejos. But I had used text based programming languages before.
I think the question is whether to invest in learning one of the above languages. In the end the investment will pay off for a project like this. Lejos will be hardest to learn but offers a nice collection of sound related functions. RobotC and NXC have equal learning curves but the support for NXC is better.
It took me about one month to get to grips with robotC and three month to get used to Lejos. But I had used text based programming languages before.
My blog: nxttime.wordpress.com
Re: NXT-G, NXC, I2C..What to use to make fastest operations?
I'm not sure, but the OP's problems with the SuperPro NXT-G block may be simply caused by timing the block without actually having the device attached to his NXT - at least it sounds like that is what he did. If it is trying to talk to a device at a different I2C address than the device he had attached uses the block might retry or something like that.
John Hansen
John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
http://bricxcc.sourceforge.net/
Re: NXT-G, NXC, I2C..What to use to make fastest operations?
Actually, I am now not certain what sensor the OP means when he refers to the LEGO Proximity sensor. Can we get some clarification? Does he mean the Ultrasonic Sensor?
John Hansen
John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
http://bricxcc.sourceforge.net/
-
- Posts: 26
- Joined: 04 Dec 2011, 12:12
Re: NXT-G, NXC, I2C..What to use to make fastest operations?
I've received the Hitecnics board today, I will soon test it.
Yes John, I talk about Utrasonic sensor.
Peter.
Yes John, I talk about Utrasonic sensor.
Peter.
-
- Posts: 18
- Joined: 28 Sep 2010, 23:57
Re: NXT-G, NXC, I2C..What to use to make fastest operations?
I don't believe the NXT-G block for the SuperPro is any slower than NXC or other language. The only operation on with the NXT-G block that is potentially less efficient is the control of the analog outputs because with this action the block sends 5 bytes of data to the SuperPro, regardless if all 5 bytes need to be sent. This is one byte for mode, two for frequency and two for voltage. So, for example, If you are only changing the frequency then you only need to send two bytes. This would actually save very little.My questions:
-I always use NXT-G, it is friendly to me. I like to think about programing without knowledge of how to use NXC, java, basic, etc... In fact those things are chinese for me.
BUT do my program would operate faster by using another thing than NXT-G ?? Which programming language is the fastest ??
-It seems I2C communication between Hitechnic SuperPro board and NXT is quite slow by using NXT-G. I have not test with card but it seems SuperPro NXT-G block takes 45ms when LEGO Proximity sensor block(another I2C device) takes only 6ms to operate.
Which laguage is the best to reduce I2C operation time?
I did some testing on the SuperPro NXT-G block and is actually faster than I expected. I tested 100 operations, subtracted a constant for the loop overhead, and then divided that by 100. Here are the results for the different actions on the SuperPro:
Code: Select all
Read analog port: 9.13ms
Read Digital port: 8.13ms
Output Digital port: 6.13ms
Write Digital Control: 6.16ms
Write Strobe: 6.13ms
Write LED: 6.15ms
Read analog: 11.12ms
Gus
- HiTechnic
Re: NXT-G, NXC, I2C..What to use to make fastest operations?
The US sensor isn't A good sensor to test I2C speed. Physical (speed of sound) and technical ( it doesn't support high speed I2C) make this sensor slower than other digital sensors.afanofosc wrote:Actually, I am now not certain what sensor the OP means when he refers to the LEGO Proximity sensor. Can we get some clarification? Does he mean the Ultrasonic Sensor?
John Hansen
Gus, what language did you use to produce the results? And what I2C settings?
My blog: nxttime.wordpress.com
Re: NXT-G, NXC, I2C..What to use to make fastest operations?
The US sensor isn't A good sensor to test I2C speed. Physical (speed of sound) and technical ( it doesn't support high speed I2C) make this sensor slower than other digital sensors.afanofosc wrote:Actually, I am now not certain what sensor the OP means when he refers to the LEGO Proximity sensor. Can we get some clarification? Does he mean the Ultrasonic Sensor?
John Hansen
Gus, what language did you use to produce the results? And what I2C settings?
My blog: nxttime.wordpress.com
Re: NXT-G, NXC, I2C..What to use to make fastest operations?
another issue of the USS is that is has fixed internal repetitive US sending/reading/calculating loops of constant intervals which start in the moment the sensor once has been configured (unless you configure the sensor for single shot mode).
IIRC, if you try to read it faster than the internal loops you are supposed to read an internal buffer value, not a relevant distance reading.
That means, taking a sensor value will not cause the sensor to send an US beam, wait for response, calculate the digital sensor value and send it back via i2c.
So IMO, if you just try to check experimentally if the sensor might response to faster i2c read cmds or not it should work (although it wouldn't make any sense anyway).
IIRC, if you try to read it faster than the internal loops you are supposed to read an internal buffer value, not a relevant distance reading.
That means, taking a sensor value will not cause the sensor to send an US beam, wait for response, calculate the digital sensor value and send it back via i2c.
So IMO, if you just try to check experimentally if the sensor might response to faster i2c read cmds or not it should work (although it wouldn't make any sense anyway).
Re: NXT-G, NXC, I2C..What to use to make fastest operations?
Gus ran his tests, I am sure, using the standard LEGO I2C speed with a program written in NXT-G.
John Hansen
I think that suggests the OP was getting bad results due to not having the actual SuperPro device connected to his NXT.I did some testing on the SuperPro NXT-G block and is actually faster than I expected.
John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
http://bricxcc.sourceforge.net/
Who is online
Users browsing this forum: No registered users and 9 guests