Go to Post Isn't that the connector used on the F.L.U.X. Capacitor? - Ed Sparks [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
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 28-01-2017, 05:51
DavidOrser DavidOrser is offline
Registered User
FRC #2987 (Rogue Robotics)
Team Role: Mentor
 
Join Date: Feb 2016
Rookie Year: 2014
Location: Minneapolis, MN
Posts: 6
DavidOrser will become famous soon enough
I2C Class Issues

Disclaimer: I'm aware that the I2C class states "This class is intended to be used by sensor (and other I2C device) drivers. It probably should not be used directly."

We have been playing with the I2C class a fair amount lately and I wanted to share those results with others and see if anyone else can confirm some of these odd behaviors. I'm not sure if its just the devices we are using or if several of the class methods are really broken.

We have the Pixy plugged into the kOnBoard I2C port. We have the Logic 4 as a scope/logic analyser.

Class functions/members/methods:
AddressOnly() // Doesn't appear to work at all
Transaction() // Write portion might work, but it reads back the same value all the time
Read() // reads back the same value all the time

ReadOnly() // works fine
WriteBulk() // Works fine
Write() // Works fine

It appears as if the Read() and Transaction() always return the first value returned by the device. I can confirm this is the pattern on the bus, due to the logic analyser. So the problem has to be either the SDA pin is being driven by the RoboRio or somehow the Start/Stop/ReStart/ACK sequence is not being handled correctly and the bus gets stuck in some way.

Anyone have experience with this type of behavior? Any other thoughts?

We were able to successfully read and write to a Lidar Lite v3 with the following code snippet:
Code:
      i2c_Lidar->Write(0x00, 0x00);
      Wait(.025);
      i2c_Lidar->Write(0x00, 0x04);
      Wait(.005);

      djoSendData[0] = 0x01;  // Bulk Write Based Read_Only for a single register Read of 0x01 (status)
      i2c_Lidar->WriteBulk(djoSendData,1);
      i2c_Lidar->ReadOnly(1,LidarMassData);
      Wait(0.001);

      djoSendData[0] = 0x8F;  // Bulk Write Based Read_Only for a two register Read of 0x8F (distance)
      i2c_Lidar->WriteBulk(djoSendData,1);
      i2c_Lidar->ReadOnly(2,LidarMassData);
Reply With Quote
  #2   Spotlight this post!  
Unread 28-01-2017, 06:07
DavidOrser DavidOrser is offline
Registered User
FRC #2987 (Rogue Robotics)
Team Role: Mentor
 
Join Date: Feb 2016
Rookie Year: 2014
Location: Minneapolis, MN
Posts: 6
DavidOrser will become famous soon enough
Re: I2C Class Issues

Please delete this thread and leave the other one intact.
Reply With Quote
  #3   Spotlight this post!  
Unread 05-02-2017, 20:14
person459's Avatar
person459 person459 is offline
Registered User
FRC #2704
 
Join Date: Oct 2014
Location: Batavia, IL
Posts: 1
person459 is an unknown quantity at this point
Re: I2C Class Issues

I concur. It's broken. It was working last year. But it seems that, as of the latest firmware upgrade, it is no longer working.

Really hoping it can be fixed. But we cannot count on that in time for our first competition. So, we're going to have rewire and reprogram to use the SPI. (Sure hope that isn't broken as well.)
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:57.

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