Go to Post If only all this food for thought happening in this thread could somehow be funneled into solving world hunger... - artdutra04 [more]
Home
Go Back   Chief Delphi > Technical > Electrical
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 23-03-2014, 22:58
Fej Fej is offline
Registered User
FRC #1672
 
Join Date: Jan 2014
Location: Mahwah, NJ
Posts: 8
Fej is an unknown quantity at this point
Simplest way to communicate Arduino to cRIO?

Question's in the title - what is the easiest and simplest way to send data from an Arduino (Uno) to a cRIO?

I've heard some about I2C, I've used it before (not in FRC) but it seems overkill just to send a few bytes.

Bit banging? It's possible. No experience there though. Might be a bit too slow (as far as I know there is no way to get time from the cRIO in increments <1ms).

Thanks guys!
  #2   Spotlight this post!  
Unread 23-03-2014, 23:00
geomapguy's Avatar
geomapguy geomapguy is offline
Centenary '18
AKA: Graham Maxwell
FRC #1818
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2011
Location: Alexandria, LA
Posts: 535
geomapguy has much to be proud ofgeomapguy has much to be proud ofgeomapguy has much to be proud ofgeomapguy has much to be proud ofgeomapguy has much to be proud ofgeomapguy has much to be proud ofgeomapguy has much to be proud ofgeomapguy has much to be proud ofgeomapguy has much to be proud ofgeomapguy has much to be proud of
Re: Simplest way to communicate Arduino to cRIO?

Quote:
Originally Posted by Fej View Post
Question's in the title - what is the easiest and simplest way to send data from an Arduino (Uno) to a cRIO?

I've heard some about I2C, I've used it before (not in FRC) but it seems overkill just to send a few bytes.

Bit banging? It's possible. No experience there though. Might be a bit too slow (as far as I know there is no way to get time from the cRIO in increments <1ms).

Thanks guys!
Depends on what you want to send.....but you could just use DIO
__________________
The Cowboys - FIRST Robotics Team #1818 2015-
The Bolton Bear Bots - FIRST Robotics Team #3666 2011-204 (30-26-0)
2014 Oklahoma Regional - 20/62 (6-4-0), 5/62 in OPR
2014 Arkansas Regional - 14/39 (8-7-0, Quarterfinalists with 1706 and 1939), 24/39 in OPR
2013 Lone Star Regional Dean's List Finalist!
2013 Lone Star Regional - 22/57 (6-5-0), 17/57 in OPR
2012 Bayou Regional - 16/49 (6-5-0)
2011 Dallas Regional - 10/52 (4-2-5, #6 Alliance Captain, Quarterfinalists with 2948 and 3350)
  #3   Spotlight this post!  
Unread 23-03-2014, 23:12
joeyoravec joeyoravec is offline
Registered User
FRC #1250 (GatorBots)
Team Role: Mentor
 
Join Date: Mar 2014
Rookie Year: 2013
Location: Livonia, MI
Posts: 14
joeyoravec is an unknown quantity at this point
Re: Simplest way to communicate Arduino to cRIO?

Quote:
Originally Posted by Fej View Post
Question's in the title - what is the easiest and simplest way to send data from an Arduino (Uno) to a cRIO?
Purchase the ethernet shield, connect using your D-Link router, and send UDP ethernet messages back-and-forth. This is what we're using for the Andy Mark LED lighting kit.
  #4   Spotlight this post!  
Unread 23-03-2014, 23:15
tStano tStano is offline
Registered User
AKA: Sparks
no team
Team Role: Electrical
 
Join Date: Jan 2014
Rookie Year: 2012
Location: Madison, WI
Posts: 177
tStano will become famous soon enough
Re: Simplest way to communicate Arduino to cRIO?

Would using several sidecar relay slots fed to inputs on the arduino work? You could use x of them to make an x-bit number. If you aren't doing complex calculations between the two, and just doing something like what light routine to run, I think that'd be good.

I suggest the relay slots because of how unlikely it is you're using all of them, but I'm not entirely sure how that signal works. I'm more sure of the DIO, but you're prolly using lots of those for other things already.

You could also use the solenoid breakout and module instead of relay channels on the sidecar, and in the same way, I'm sure that would work.

Last edited by tStano : 23-03-2014 at 23:16. Reason: looked poorly formatted when originally posted. Also, spelling
  #5   Spotlight this post!  
Unread 23-03-2014, 23:32
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Simplest way to communicate Arduino to cRIO?

Quote:
Originally Posted by tStano View Post
Would using several sidecar relay slots fed to inputs on the arduino work?
No, because the relay outputs are only outputs, and Arduino inputs are inputs, and that would only get data from the cRIO to the Arduino. The question is about sending data in the other direction.

The simplest way is to use as many DIO inputs on the Digital Sidecar as you need to communicate the necessary data. Sometimes that might be a single bit, giving the answer to the question "Am I facing a hot goal right now?"
  #6   Spotlight this post!  
Unread 24-03-2014, 11:04
Fej Fej is offline
Registered User
FRC #1672
 
Join Date: Jan 2014
Location: Mahwah, NJ
Posts: 8
Fej is an unknown quantity at this point
Re: Simplest way to communicate Arduino to cRIO?

I need to send around 8 bytes worth of data. Obviously, there aren't that many DIO pins available. As for communicating via ethernet, we only have one port left open on our router and it is used for tethering when needed. Other two are an RPi and an Axis camera.

I could use the Pi instead of an Arduino, but I'm not familiar with the Pi really
  #7   Spotlight this post!  
Unread 24-03-2014, 11:37
SteveGarward's Avatar
SteveGarward SteveGarward is offline
Red 5, standing by...
AKA: 7 years already
FRC #0111 (WildStang), FRC #3132 (Thunder Down Under)
Team Role: Mentor
 
Join Date: Dec 2009
Rookie Year: 2010
Location: Gurnee, IL
Posts: 173
SteveGarward has much to be proud ofSteveGarward has much to be proud ofSteveGarward has much to be proud ofSteveGarward has much to be proud ofSteveGarward has much to be proud ofSteveGarward has much to be proud ofSteveGarward has much to be proud ofSteveGarward has much to be proud ofSteveGarward has much to be proud ofSteveGarward has much to be proud of
Re: Simplest way to communicate Arduino to cRIO?

I2C would likely be the easiest for 8 bytes of data. On the Arduino side, the Wire library makes it very easy. On the robot/cRIO side, the libraries provided make it simple too. You also only need 3 wires, and it frees up all your DIO for other purposes.
__________________
FRC Team 111 - WildStang (Mentor, Drive Coach)
FTC Team 7458 - Full Force! (Mentor, Coach)
FRC Team 3132 - Australia's FIRST FRC Team! (Holy crazy first year, Batman!)

  #8   Spotlight this post!  
Unread 24-03-2014, 13:36
Mike Bortfeldt Mike Bortfeldt is offline
Registered User
FRC #1126 (& 1511)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2004
Location: Rochester, NY
Posts: 119
Mike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud of
Re: Simplest way to communicate Arduino to cRIO?

Fej,

There are several ways I can think of to communicate between an Arduino and the cRIO. None of which are probably as easy as you would like.

1) RS-232 - Although you may need a level shifter on the signal lines
2) Ethernet (as mentioned earlier)
3) I2C - Note that the cRIO limits the message length to 7 bytes, so you would need to split up your communication into two transactions. The cRIO must also be the Master.

Mike
  #9   Spotlight this post!  
Unread 26-03-2014, 12:16
slibert slibert is offline
Software Mentor
AKA: Scott Libert
FRC #2465 (Kauaibots)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2005
Location: Kauai, Hawaii
Posts: 359
slibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud of
Re: Simplest way to communicate Arduino to cRIO?

My 2c:

The nav6 open-source IMU we developed is basically an Arduino UNO plus some ICs (gyro/accelerometer/magnetometer); after lots of experimenting during development, we found the simplest thing that could possibly work for communication was the RS-232 serial port.

This requires a USB to RS-232 converter serial cable, which is easily available.

As others have noted, I2C/SPI are also possible, but in my experience the code on the Arduino side (to be a I2C/SPI "slave" that receives messages and responds) is more complicated than receiving/responding to messages over the serial port.

Add to this that serial communication is much more easily debugged via a serial monitor like that provided in the Arduino IDE.

The only downside we found is that the WPI Library SerialPort class (in Java, specifically) had some bugs requiring some workarounds.

Next year, the advent of the RoboRIO will change this recommendation to: USB. This will provide both power and signal connections in a single, inexpensive cable, and the bandwidth should be the same or higher.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 19:22.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi