Might I ask why you would need such speeds? There are not much sensors that can update so fast. There Is no use in querying a sensor faster than it updates nor faster then you can process it.mattallen37 wrote:If you use the fast mode (exclusive to the later versions of the EFW), I think the bus runs at about 30kbps instead of 9.6kbps.
The analog values are updated at 300Hz.
For I2C, I think you would need 400kbps in order to get readings every 0.1ms, and even then you would be really pushing it. Even 1ms read intervals is probably not possible. Based on testing I have done, it seems that using fast mode with the EFW, the read time is like 2 to 3ms.
NXT reading speed
Re: NXT reading speed
My blog: nxttime.wordpress.com
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: NXT reading speed
He wanted to read something like a TSOP (IR receiver) through an I2C IO expander. In that case, you would need to have super high speed updates.
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
Re: NXT reading speed
I finally prefer buying an arduino one, i wil buy another one later if really i need.
I thought of something else : Is it possible to use A pcf8574 to make a bit-banged rs232 emulation at 9600bps ?
I thought of something else : Is it possible to use A pcf8574 to make a bit-banged rs232 emulation at 9600bps ?
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: NXT reading speed
An Arduino one? Do you mean Uno? "Uno" in Spanish means one, but "Uno" is also the name of an Arduino.floppi wrote:I finally prefer buying an arduino one, i wil buy another one later if really i need.
I thought of something else : Is it possible to use A pcf8574 to make a bit-banged rs232 emulation at 9600bps ?
Possibly, but you would need super fast I2C to make that work (like maybe 400kbps).
UART with an Arduino is easy, but it's TTL levels, not RS232. You would need a MAX232 (or similar) IC to make the signals RS232 levels.
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: NXT reading speed
If half duplex is fine, then you can use the RS485 UART.
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
Re: NXT reading speed
The arduino has been shipped to me, just for the week-end......
My wife will not be happy
My wife will not be happy
-
- Posts: 323
- Joined: 29 Sep 2010, 05:03
Re: NXT reading speed
If what you need is access to analogue data then you can use the A/D ports on the AT91. Basically you make use of one of the NXT sensor port digital pins as an analogue input (see the Lego hardware doc for the details). This is what is used by the Lego Color sensor. I'm not sure if the standard or enhanced firmware allows you to switch the pins into A/D mode and access to the resulting values. certainly leJOS does (our Lego color sensor driver is written in Java and runs as standard user code). Using this interface you can sample the analogue values very fast. If you setup the hardware correctly you can basically sample the A/D values using hardware, and once you do this obtaining a value is essentially the same as reading a memory address. In leJOS we have the hardware sample rate set to 4MHz, which is faster then a leJOS program can actually make a call to read a new value and do anything useful with it.
Having said all of that, for your application it probably makes more sense to go the route you are currently going and have an additional microcontroller do all of the low level stuff...
Andy
Having said all of that, for your application it probably makes more sense to go the route you are currently going and have an additional microcontroller do all of the low level stuff...
Andy
Re: NXT reading speed
So,
NXT, Arduino and PCF8591 on I2C bus works well. ( thanks to mattallen37 ! )
Arduino is used to
- have a 1024bit analog input ( more precise than NXT ) to detect resistive value of conductive foam.
- manage IR LED to drive Lego PF motor.
- manage PCF8591 to add more analog input. ( sound detector, photoresistor, motion detector )
So the the NXT will be quiet to drive his ultrasonic sensor and motors.
NXT, Arduino and PCF8591 on I2C bus works well. ( thanks to mattallen37 ! )
Arduino is used to
- have a 1024bit analog input ( more precise than NXT ) to detect resistive value of conductive foam.
- manage IR LED to drive Lego PF motor.
- manage PCF8591 to add more analog input. ( sound detector, photoresistor, motion detector )
So the the NXT will be quiet to drive his ultrasonic sensor and motors.
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: NXT reading speed
You mean 10 bit? A 10 bit number is a number between 0 and 1023. The NXT and Arduino both have 10 bit ADCs (although the analog inputs on the NXT have permanent 10k pullup resistors).
How are you controlling the IR LED? I wrote an Arduino library for that as well, in case you're interested.
How are you controlling the IR LED? I wrote an Arduino library for that as well, in case you're interested.
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
Who is online
Users browsing this forum: No registered users and 3 guests