2010-07-15 08:53:48 i2cget and high data addresses
Reggy Perrin (UNITED STATES)
Message: 91296
Hi folks,
I'm trying to see if I'm doing inherently wrong here, but I just don't see it. We have an audio codec on the i2c bus, and successfully are using alsa to play sounds. However, our audio engineers are requesting direct access to the audio registers, and not an alsa interface.
I've compiled the i2c tools, and the following works well:
root:/> i2cget -y -f 0 0x1b 0 w
0x8990
So, reading register 0 of the device at 0x1b address returns 0x8990. That's exactly right. However, this only works for registers 0-3. As soon as I try and access a register > 3, I start getting back 0's:
root:/> i2cget -y -f 0 0x1b 0x22 w
0x0000
Is this a limitation of of i2c, or a bug that must be fixed? Any ideas?
Thanks
RP
QuoteReplyEditDelete
2010-07-15 09:04:20 Re: i2cget and high data addresses
Reggy Perrin (UNITED STATES)
Message: 91298
Another interesting data point I didn't notice earlier: If I enable all the debug logging within the i2c kernel driver, I get:
root:/> i2cdump -f -y 0 0x1b w
0,8 1,9 2,a 3,b 4,c 5,d 6,e 7,f
00: 9089 1500 0068 0001 0000 0000 0000 0000
08: 0000 0000 0000 0000 0000 0000 0000 0000
10: 0000 0000 0000 0000 0000 0000 0000 0008
18: 0000 0000 0000 0000 0000 0000 0000 0000
[ 3020.364000] i2c i2c-0: smbus transfer timeout
Does this indicate something?
QuoteReplyEditDelete
2010-07-15 09:41:29 Re: i2cget and high data addresses
Mike Frysinger (UNITED STATES)
Message: 91303
what if you use i2cdump and the different transfer modes ?
QuoteReplyEditDelete
2010-07-15 09:54:15 Re: i2cget and high data addresses
Reggy Perrin (UNITED STATES)
Message: 91307
Hi Mike,
Here's a sampling. Just showing the first row, as subsequent rows are all 0's:
root:/> i2cdump -f -y 0 0x1b b
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: 89 00 68 01 00 00 00 00 00 00 00 00 00 00 00 00 ?.h?............
root:/> i2cdump -f -y 0 0x1b W
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: 89 90 68 00 00 00 00 00 00 00 00 00 00 00 00 00 ??h.............
root:/> i2cdump -f -y 0 0x1b i
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: 89 90 00 15 68 00 01 00 00 00 00 00 00 00 00 00 ??.?h.?.........
Seems pretty consistent
RP
QuoteReplyEditDelete
2010-07-15 10:26:30 Re: i2cget and high data addresses
Robin Getz (UNITED STATES)
Message: 91312
Reggy:
I assumed that you checked the hardware -- and made sure that the pull up resistors are sized properly (for your bus Cp) and rise/fall times are withing the I2C spec?
www.i2c-bus.org/typical-i2c-bus-setup/
www.electro-tech-online.com/attachments/robotics-mechatronics/8176d1148945680-srf08-hcs12-i2c-setup-help-bus-design-pullup-resistor-calculation-i2c-smbus-busses-smi2c_10.pdf
page 8-9
-Robin