Go to Post I Don't like to think in the Box so i try not to make robots look like them. - Tytus Gerrish [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 06-07-2016, 15:34
CSkillet CSkillet is offline
Registered User
FRC #0135
 
Join Date: Jan 2016
Location: Indiana
Posts: 4
CSkillet is an unknown quantity at this point
I2C Communication between RoboRIO and Arduino

Hello,
So I've been trying to send data from the RoboRIO to the Arduino UNO using the Transaction() function of the I2C Class of the C++ WPILib. I have the address all connected, because AddressOnly() returns false, meaning a success. However, Transaction() returns true, meaning the process aborted, and that's my problem. It's not a problem on the Arduino side because its not receiving any data at all.
I have switched off and on between using the built in I2C port and the MXP port on the RoboRIO, but neither have worked. I have the SDA, SCL, and Ground pins set up, but not the voltage, as the Arduino would not operate at 3.3V. Moreover, I just have the Arduino plugged into a computer. I would assume the wiring is good because the RoboRIO can sense that there is a device at the Arduino I2C address.

Here is some of the code on the RoboRIO side:

Header File (.h):

char START_INDICATOR = 'S';
unsigned char byteDataToSend;
unsigned char* CONVERTED_START_INDICATOR;

.cpp File

CONVERTED_START_INDICATOR = new unsigned char;

byteDataToSend = reinterpret_cast<unsigned char&>(START_INDICATOR)
CONVERTED_START_INDICATOR = &byteDataToSend;

i2C->Transmission(CONVERTED_START_INDICATOR , 1, NULL, 0)


Any help is appreciated, thanks
Reply With Quote
  #2   Spotlight this post!  
Unread 06-07-2016, 16:10
NHollander NHollander is offline
Registered User
FRC #2877
 
Join Date: Jul 2016
Location: Newton, MA
Posts: 1
NHollander is an unknown quantity at this point
Re: I2C Communication between RoboRIO and Arduino

In order to get the arduino to communicate over I2C, I found that it is necessary to connect all 4 pins from the RoboRIO socket to the appropriate terminals on the arduino.

For our robot this year, we had a Teensy LC controlling LED strips, which were controlled over I2C. For the longest time, we could not get the RoboRIO to talk with the arduino, even when it saw an I2C device was present.

In order to get it to work, we had to have the 4 wires from the RoboRIO, as well as 5V coming from a second VRM, which also supplied the power necessary to drive the LED strips. One additional challenge we ran into was dealing with finding the appropriate pullup to use. In the end, we settled with the internal resistors, which were larger than necessary, and therefore resulted in less than ideal communication speeds, but it worked.
Reply With Quote
Reply


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 09:42.

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