View Single Post
  #2   Spotlight this post!  
Unread 19-02-2011, 22:01
David Fort David Fort is offline
Registered User
FRC #1001
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2003
Location: Cleveland, OH
Posts: 26
David Fort is on a distinguished road
Re: Multiple I2C sensors

I haven't tried this myself, but since the topic of multiple I2C sensors has become of interest to our team (after 2 days of extensive failures on other topics, followed by a pretty good FTC day at Erie PA), I looked in the sensor manual for the ADXL345 which can be used via I2C.

It says there is a way to change the Address on I2C by shorting 2 pads on the circuit board with a blob of solder.

The example LabView Open VI for the ADXL345 (which can be found in the sample FRC programs, on the link in the bottom right of the first screen, in the I2C bucket) has the "default" (non-solder-blobbed) ADXL345 I2C address connected to the underlying WPI I2C Open block via a "constant" wired to the pin.

Therefore, I would bet that the CRIO can support multiple I2C peripherals on the bus, and (for example) if you wanted to use 2 ADXL345's, you would add the solder blob to one of them and modify the example ADXL345 Open Vi to pass in the I2C address on one of the function block Terminals (or copy the whole thing and change the constant value in one of the copies).

I use this only as a silly example, since who in their right mind would use 2 3 axis accelerometers on one robot, but since FRC teams are known to not be in their right minds, our team tried to do just that last year, to measure the acceleration at opposite ends of the robot to see if we could figure out (and control) the center of rotation. The answer was, uh. no. (but perhaps with more patience, and filtering, and resolution we could have).

Another angle(weak pun intended) to consider is that some sensors (again, the ADXL345 for example) can be used on both I2C and SPI, so perhaps you can move one of your sensors to SPI and avoid the whole question of multidropped I2C.

Please let us know if you attempt this and whether or not you succeed!

Thanks,
David Fort
Mentor, Team 1001
Reply With Quote