View unanswered posts | View active topics It is currently Thu Apr 17, 2014 2:28 pm






Reply to topic  [ 5 posts ] 
Maximum message Length size in I2C sendI2CMsg() 
Author Message
Rookie
User avatar

Joined: Fri Mar 21, 2008 8:00 pm
Posts: 20
Location: Spain
Post Maximum message Length size in I2C sendI2CMsg()
Hi,

I'm sending a big amount of data by I2C from the NXT as Master to an Arduino slave device.

My problem is when the sendI2CMsg() sends more than 15 bytes.
When the size of the packet is over 15 bytes in the Arduino size always the reception is 15bytes.

Is in the NXT side a limitiation or a variable to establish the size to send packets over 15 bytes of data?

Thank you.

_________________
Nobody knows what you're capable ... until you get down to it.


Mon Mar 11, 2013 8:58 am
Profile WWW
Rookie
User avatar

Joined: Fri Mar 21, 2008 8:00 pm
Posts: 20
Location: Spain
Post Re: Maximum message Length size in I2C sendI2CMsg()
As I supposed, there are a 16 bytes LEGO NXT limitation in the input/output i2c buffering, as is described in the HDK.:-(

With this limitation the maximun I2C througput is about 232 writes per second or 26kbps(payload).
232writes per second*8bits per byte*14bytes(payload)=26kbps.

_________________
Nobody knows what you're capable ... until you get down to it.


Tue Mar 12, 2013 4:52 am
Profile WWW
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3105
Location: Rotterdam, The Netherlands
Post Re: Maximum message Length size in I2C sendI2CMsg()
I wrote some articles about this a while back:

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Tue Mar 12, 2013 8:03 am
Profile WWW
Expert

Joined: Thu Sep 29, 2011 11:09 pm
Posts: 184
Location: Michigan USA
Post Re: Maximum message Length size in I2C sendI2CMsg()
With the standard Lego FW I2C being limited to 9600 bps (not even "fast" I2C is supported in the lego FW), I felt I needed a much faster means of communication. I now mostly use RS485. The Arduino and NXT communicate nicely at 115200 baud (or 11.5 kBps payload, which would be about 92 kbps).

_________________
Matt


Tue Mar 12, 2013 10:58 am
Profile WWW
Expert

Joined: Thu Sep 29, 2011 11:09 pm
Posts: 184
Location: Michigan USA
Post Re: Maximum message Length size in I2C sendI2CMsg()
Oh, and RS485 allows many more bytes in a single transaction (much larger buffers). IIRC, the Arduino Serial buffers are limited to either 32 or 64 bytes. I'm pretty sure the Lego NXT FW allowed 64 bytes, but John Hansen's EFW allows up to 128 bytes. I would assume the ROBOTC FW allows up to either 64 or 128 bytes.

_________________
Matt


Tue Mar 12, 2013 11:02 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.