Quantcast

I2C Without Slave Address

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

I2C Without Slave Address

Evan
Hi all,

I am trying to communicate via i2c with an Adafruit 16-Channel 12-bit PWM/Servo Driver. This device receives i2c input signals, then outputs pulses to 16 pwm ports. The issue is that the manufacturer only includes "write" addresses (depending on which solder jumpers are used). I have working voltage level converters from 1.8V to 5V, and I have tried a variety of combinations with the solder jumpers, but whenever I type "i2cdetect -y -r 3" in the command window, no slave addresses from this device are shown.

Normally I would control the i2c with c code by opening the port with 'fh', then ioctl(fh, I2C_SLAVE, slave_addr), then write(), but I cannot do this with only a "write" address and no "slave" addresses.

Would you have any suggestions with communicating via i2c with only a "write" address? Any help would be much appreciated. Thank you.

Evan
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: I2C Without Slave Address

the suicidal eggroll
Hi Evan,

The "write" address IS the "slave" address.  Depending on the manufacturer and their terminology, you may need to bitshift by 1, but other than that they're one in the same.

See here for more info (under the heading Userland Programming):
http://www.jumpnowtek.com/index.php?option=com_content&view=article&id=69&Itemid=78

If using the "write" address as the "slave" address doesn't work, try bitshifting right by 1 (0x40 becomes 0x20, 0x26 becomes 0x13, etc).

-Adam


On 03/27/2013 06:23 PM, Evan wrote:
Hi all,

I am trying to communicate via i2c with an Adafruit 16-Channel 12-bit
PWM/Servo Driver. This device receives i2c input signals, then outputs
pulses to 16 pwm ports. The issue is that the manufacturer only includes
"write" addresses (depending on which solder jumpers are used). I have
working voltage level converters from 1.8V to 5V, and I have tried a variety
of combinations with the solder jumpers, but whenever I type "i2cdetect -y
-r 3" in the command window, no slave addresses from this device are shown.

Normally I would control the i2c with c code by opening the port with 'fh',
then ioctl(fh, I2C_SLAVE, slave_addr), then write(), but I cannot do this
with only a "write" address and no "slave" addresses.

Would you have any suggestions with communicating via i2c with only a
"write" address? Any help would be much appreciated. Thank you.

Evan




--
View this message in context: http://gumstix.8.n6.nabble.com/I2C-Without-Slave-Address-tp4967069.html
Sent from the Gumstix mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Own the Future-Intel® Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game 
on Steam. $5K grand prize plus 10 genre and skill prizes. 
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users


------------------------------------------------------------------------------
Own the Future-Intel® Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game
on Steam. $5K grand prize plus 10 genre and skill prizes.
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: I2C Without Slave Address

Dave Hylands
In reply to this post by Evan
Hi Evan,


On Wed, Mar 27, 2013 at 5:23 PM, Evan <[hidden email]> wrote:
Hi all,

I am trying to communicate via i2c with an Adafruit 16-Channel 12-bit
PWM/Servo Driver. This device receives i2c input signals, then outputs
pulses to 16 pwm ports. The issue is that the manufacturer only includes
"write" addresses (depending on which solder jumpers are used). I have
working voltage level converters from 1.8V to 5V, and I have tried a variety
of combinations with the solder jumpers, but whenever I type "i2cdetect -y
-r 3" in the command window, no slave addresses from this device are shown.

Normally I would control the i2c with c code by opening the port with 'fh',
then ioctl(fh, I2C_SLAVE, slave_addr), then write(), but I cannot do this
with only a "write" address and no "slave" addresses.

Would you have any suggestions with communicating via i2c with only a
"write" address? Any help would be much appreciated. Thank you.

What you actually have is a 7-bit address followed by a 1-bit read/write command.

It may be that the device only responds to writes, which would explain why it doesn't show up in i2c-detect.

The slave address will be just the seven bits.

So, for example, if the "write address" was 0x42 (which is 01000010 in binary) then this corresponds to an i2c address of 0100001 and a R/W bit of 0.

So the i2c slave address would be 0x21, and the R/W bit of 0 means write.

--
Dave Hylands
Shuswap, BC, Canada
http://www.davehylands.com

------------------------------------------------------------------------------
Own the Future-Intel&reg; Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game
on Steam. $5K grand prize plus 10 genre and skill prizes.
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: I2C Without Slave Address

Evan
Adam and Dave,

Thank you very much for your responses. I have a better understanding of how to call these devices. I am working through some other problems with the Adafruit driver, but I will post c codes to this forum as soon as I have something successfully working.

Thanks again,
Evan
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: I2C Without Slave Address

Evan
As promised (sorry a little overdue), here is a code to control multiple servos using the Gumstix i2c bus to communicate with an Adafruit 16-Channel 12-bit PWM/Servo Driver (https://github.com/evankaufman/Adafruit_PCA9685_ServoControl). I hope that whoever Googles these words finds the code that they are looking for.

Evan Kaufman
Loading...