View Single Post
  #4   Spotlight this post!  
Unread 03-02-2014, 10:26
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: I2C Arduino Port (Wii MotionPlus)

Kyle,

The I2C specification calls out for a 7 bit device address (there is also a 10 bit address, but that doesn't apply here), along with a single bit to indicate read/write. This information is combined where the address is the high 7 bits and the read/write is the LSB as shown below, where 'A' indicates an address bit and R indicates the read/write bit (write is 0, read is 1)

Code:
Bit (MSB) 76543210 (LSB)
          AAAAAAAR
Some devices interpret this (or at least sometimes describes it) as two 8 bit addresses, one for read one for write. The Arduino uses the specificed 7 bit address and internally bit shifts it by 1 (effectively multiplying the address by 2) and then adds the read/write. The cRio wants you to specifiy the address already bit shifted. You'll notice that the cRio addresss I gave is the same as the Arduino * 2.

Hopefully this makes sense.

Mike

For reference, I found the I2C bus specification here : http://www.nxp.com/documents/user_manual/UM10204.pdf

Last edited by Mike Bortfeldt : 03-02-2014 at 10:46. Reason: added reference
Reply With Quote