* i2c_smbus_write_block_data does not send all bytes?!
@ 2008-07-15 8:29 Nick Teen
[not found] ` <884255.29098.qm-WOTGQye7mknGRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org>
0 siblings, 1 reply; 13+ messages in thread
From: Nick Teen @ 2008-07-15 8:29 UTC (permalink / raw)
To: i2c-GZX6beZjE8VD60Wz+7aTrA
> I don't remember any similar problem, so no idea either. I can only
> suspect that your bus driver is doing something wrong. So please give
> us the detail of your setup:
>
> * Which version of i2c-dev.h are you using?
libi2c-dev, 3.0.0-1 (debian)
> * What architecture are you working on?
i386
> * Which kernel version are you using?
2.6.24.2
> * What i2c bus driver are you using?
i2c_i801 9008 0
i2c_dev 8164 0
smsc47m1 9700 0
smsc47m192 14656 0
> * How do you know for sure what actually goes on the bus?
Milksop GPL Reflasher - 0.20 - (c)2002 andy-/Zus8d0mwwtBDgjK7y7TUQ@public.gmane.org
with CheapI2C
I hope this helps... writing words & bytes works fine.
Regards,
Nick
__________________________________________________________
Gesendet von Yahoo! Mail.
Dem pfiffigeren Posteingang.
http://de.overview.mail.yahoo.com
_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c
^ permalink raw reply [flat|nested] 13+ messages in thread[parent not found: <884255.29098.qm-WOTGQye7mknGRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org>]
* Re: i2c_smbus_write_block_data does not send all bytes?! [not found] ` <884255.29098.qm-WOTGQye7mknGRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org> @ 2008-07-15 10:57 ` Jean Delvare [not found] ` <20080715125702.48c9569b-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org> 0 siblings, 1 reply; 13+ messages in thread From: Jean Delvare @ 2008-07-15 10:57 UTC (permalink / raw) To: Nick Teen; +Cc: i2c-GZX6beZjE8VD60Wz+7aTrA On Tue, 15 Jul 2008 08:29:27 +0000 (GMT), Nick Teen wrote: > > I don't remember any similar problem, so no idea either. I can only > > suspect that your bus driver is doing something wrong. So please give > > us the detail of your setup: > > > > * Which version of i2c-dev.h are you using? > > libi2c-dev, 3.0.0-1 (debian) > > > * What architecture are you working on? > > i386 > > > * Which kernel version are you using? > > 2.6.24.2 > > > * What i2c bus driver are you using? > > i2c_i801 9008 0 > i2c_dev 8164 0 Hmm, did you connect something to a SMBus header on your motherboard? Or are you talking to an I2C chip on your motherboard? > smsc47m1 9700 0 Not related to i2c at all... > smsc47m192 14656 0 An i2c chip driver, unrelated to your problem. > > > * How do you know for sure what actually goes on the bus? > > Milksop GPL Reflasher - 0.20 - (c)2002 andy-/Zus8d0mwwtBDgjK7y7TUQ@public.gmane.org > with CheapI2C Err, what is this exactly? Hardware? Software? Please explain your setup in details. > I hope this helps... writing words & bytes works fine. -- Jean Delvare _______________________________________________ i2c mailing list i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org http://lists.lm-sensors.org/mailman/listinfo/i2c ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <20080715125702.48c9569b-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>]
* Re: i2c_smbus_write_block_data does not send all bytes?! [not found] ` <20080715125702.48c9569b-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org> @ 2008-07-15 12:22 ` Nick Teen [not found] ` <952972.59634.qm-WQsacCdWWGLGRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org> 0 siblings, 1 reply; 13+ messages in thread From: Nick Teen @ 2008-07-15 12:22 UTC (permalink / raw) To: i2c-GZX6beZjE8VD60Wz+7aTrA --- Jean Delvare wrote: > > > * What i2c bus driver are you using? > > > > i2c_i801 9008 0 > > i2c_dev 8164 0 > > Hmm, did you connect something to a SMBus header on your > motherboard? > Or are you talking to an I2C chip on your motherboard? I try to run linux on my iptv box. 0x5d is a I2C talking PIC on the frontpanel. > > > * How do you know for sure what actually goes on > the bus? > > > > Milksop GPL Reflasher - 0.20 - (c)2002 > andy-/Zus8d0mwwtBDgjK7y7TUQ@public.gmane.org > > with CheapI2C > > Err, what is this exactly? Hardware? Software? Please > explain your setup in details. I've attached SDA, SCL of my device using a cmos 4050 to my parport. Take a look: http://ivtv.writeme.ch/tiki-index.php?page=Monitoring+I2C+Bus Nick __________________________________________________________ Unglücklich mit Ihrer Mail-Adresse? Millionen neuer Mail-Adressen - jetzt bei Yahoo! http://de.docs.yahoo.com/mail/wunschmailadresse/index.html _______________________________________________ i2c mailing list i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org http://lists.lm-sensors.org/mailman/listinfo/i2c ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <952972.59634.qm-WQsacCdWWGLGRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org>]
* Re: i2c_smbus_write_block_data does not send all bytes?! [not found] ` <952972.59634.qm-WQsacCdWWGLGRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org> @ 2008-07-15 12:32 ` Jean Delvare [not found] ` <20080715143258.2bef9c1e-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org> 0 siblings, 1 reply; 13+ messages in thread From: Jean Delvare @ 2008-07-15 12:32 UTC (permalink / raw) To: xpage_de-LWAfsSFWpa4; +Cc: i2c-GZX6beZjE8VD60Wz+7aTrA On Tue, 15 Jul 2008 12:22:05 +0000 (GMT), Nick Teen wrote: > --- Jean Delvare wrote: > > > > * What i2c bus driver are you using? > > > > > > i2c_i801 9008 0 > > > i2c_dev 8164 0 > > > > Hmm, did you connect something to a SMBus header on your > > motherboard? > > Or are you talking to an I2C chip on your motherboard? > > I try to run linux on my iptv box. 0x5d is a I2C talking PIC on the frontpanel. > > > > > * How do you know for sure what actually goes on > > the bus? > > > > > > Milksop GPL Reflasher - 0.20 - (c)2002 > > andy-/Zus8d0mwwtBDgjK7y7TUQ@public.gmane.org > > > with CheapI2C > > > > Err, what is this exactly? Hardware? Software? Please > > explain your setup in details. > > I've attached SDA, SCL of my device using a cmos 4050 to my parport. > Take a look: http://ivtv.writeme.ch/tiki-index.php?page=Monitoring+I2C+Bus If that's all the details you can provide, then you're on your own, sorry. I won't spend the whole day extracting every bit of information from you. -- Jean Delvare _______________________________________________ i2c mailing list i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org http://lists.lm-sensors.org/mailman/listinfo/i2c ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <20080715143258.2bef9c1e-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>]
* Re: i2c_smbus_write_block_data does not send all bytes?! [not found] ` <20080715143258.2bef9c1e-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org> @ 2008-07-15 13:02 ` Nick Teen [not found] ` <732644.12112.qm-qWTMlLQujKzGRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org> 0 siblings, 1 reply; 13+ messages in thread From: Nick Teen @ 2008-07-15 13:02 UTC (permalink / raw) To: i2c-GZX6beZjE8VD60Wz+7aTrA --- Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org> wrote: > If that's all the details you can provide, then you're on your own, > sorry. I won't spend the whole day extracting every bit of information > from you. Sorry for disturbing the peace... my setup is very simple and I cannot gauge whats important and what is unimportant. My idea was to send an I2C command to the frontpanel pic to switch on an LED. I've captured the traffic (of the orig. OS) and trying to send these commands again under linux. But you see: without success. Thanks for your endeavours! I dont want to steal your time. Regards, Nick __________________________________________________________ Gesendet von Yahoo! Mail. Dem pfiffigeren Posteingang. http://de.overview.mail.yahoo.com _______________________________________________ i2c mailing list i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org http://lists.lm-sensors.org/mailman/listinfo/i2c ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <732644.12112.qm-qWTMlLQujKzGRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org>]
* Re: i2c_smbus_write_block_data does not send all bytes?! [not found] ` <732644.12112.qm-qWTMlLQujKzGRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org> @ 2008-07-15 13:13 ` Jean Delvare [not found] ` <785052.52325.qm@web27604.mail.ukl.yahoo.com> 0 siblings, 1 reply; 13+ messages in thread From: Jean Delvare @ 2008-07-15 13:13 UTC (permalink / raw) To: xpage_de-LWAfsSFWpa4; +Cc: i2c-GZX6beZjE8VD60Wz+7aTrA On Tue, 15 Jul 2008 13:02:31 +0000 (GMT), Nick Teen wrote: > --- Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org> wrote: > > If that's all the details you can provide, then you're on your own, > > sorry. I won't spend the whole day extracting every bit of information > > from you. > > Sorry for disturbing the peace... my setup is very simple and I > cannot gauge whats important and what is unimportant. My idea was > to send an I2C command to the frontpanel pic to switch on an LED. > I've captured the traffic (of the orig. OS) and trying to send > these commands again under linux. But you see: without success. > > Thanks for your endeavours! I dont want to steal your time. My point is that if you want more help, you have to provide information. Nobody here can guess what your setup is, especially when you are apparently doing something unusual. For example: what is an "iptv box"? You shouldn't assume that everybody know what it is. I have no clue! What we need, amongst other things, is a clear view of what your physical environment is. You apparently have a PIC connected on some I2C bus, but you never clearly said what I2C bus it was! I suspect a bus driver bug, but at this point I simply have no idea which driver that would be. You mentioned the i2c-i801 driver, but I would be very surprised to see a PIC connected on that bus, unless you soldered it yourself. So, please don't only answer my questions: anticipate them. Tell us everything that might be useful. And don't fear to give us too much information - it's way better than not enough information, and we can filter out anything that we don't think is relevant. -- Jean Delvare _______________________________________________ i2c mailing list i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org http://lists.lm-sensors.org/mailman/listinfo/i2c ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <785052.52325.qm@web27604.mail.ukl.yahoo.com>]
[parent not found: <785052.52325.qm-qWTMlLQujKzGRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org>]
* Re: i2c_smbus_write_block_data does not send all bytes?! [not found] ` <785052.52325.qm-qWTMlLQujKzGRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org> @ 2008-07-15 16:52 ` Jean Delvare [not found] ` <20080715185223.7f2f39aa-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org> 0 siblings, 1 reply; 13+ messages in thread From: Jean Delvare @ 2008-07-15 16:52 UTC (permalink / raw) To: xpage_de-LWAfsSFWpa4, Linux I2C Hi Nick, Please keep the i2c list in Cc. On Tue, 15 Jul 2008 16:24:21 +0000 (GMT), Nick Teen wrote: > --- Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org> wrote: > > > I2C bus, but you never clearly said what I2C bus it was! I > > suspect a bus driver bug, but at this point I simply have no idea > > which driver that would be. You mentioned the i2c-i801 driver, but I > > would be very surprised to see a PIC connected on that bus, unless you > > soldered it yourself. > > Okay, I will try to tell about the iptv box. The name is ip1101 and manufactured by thomson. It is a common set-top box for internet television and comes with WinCE. If you open the box you can see a intel854 mainboard and a celeron-m 600mhz. In other words it is a personal computer... but it has a frontpanel. You can see it in the picture: > > http://blog.pregos.info/wp-content/uploads/2008/03/thomsonip1101.jpg > > Under WinCE i can sniff (via "milk") on the I2C bus every button > press and the commands to switch on/off the leds (i think so). The > frontpanel has a PIC which talks I2C and is connected to one of > the SMSC-chips. If I disconnect the frontpanel-cable the address > 0x5d disappear (i2cdetect). Which bus do you see the device on in i2cdetect? You said earlier that you were using the i2c-i801 driver, which is expected for an Intel motherboard. However you say that the PIC is connected to an SMSC chip, and not the Intel south bridge? Are you sure? If you are, what is the name of the SMSC chip in question? Which i2c bus are you running your program on? The "SMBus I801" one? Note that it is not entirely impossible that the block write support in the i2c-i801 driver is broken. This is a driver which is mostly used to access SPD EEPROMs and hardware monitoring chips, to which you never write blocks. > I can provide shell-access to the box if it helps. Thanks, but no thanks. I may try to help you but I'm not going to do all the work for you ;) -- Jean Delvare _______________________________________________ i2c mailing list i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org http://lists.lm-sensors.org/mailman/listinfo/i2c ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <20080715185223.7f2f39aa-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>]
* Re: i2c_smbus_write_block_data does not send all bytes?! [not found] ` <20080715185223.7f2f39aa-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org> @ 2008-07-15 17:28 ` Nick Teen [not found] ` <968764.38783.qm-fkCdBXra523GRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org> 0 siblings, 1 reply; 13+ messages in thread From: Nick Teen @ 2008-07-15 17:28 UTC (permalink / raw) To: Jean Delvare, i2c-GZX6beZjE8VD60Wz+7aTrA --- Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org> wrote: > Which bus do you see the device on in i2cdetect? You said > earlier that you were using the i2c-i801 driver, which is expected for > an Intel motherboard. However you say that the PIC is connected to > an SMSC chip, and not the Intel south bridge? Are you sure? If you are, > what is the name of the SMSC chip in question? Okay, i was wrong. The smsc47m192 _and_ the PIC is connected to the SMBus I801 (at a040). If i type "sensors", i get sensor data from 0x2d. > Which i2c bus are you running your program on? The > "SMBus I801" one? I'm afraid so. > Note that it is not entirely impossible that the block > write support in the i2c-i801 driver is broken. This is a driver which is > mostly used to access SPD EEPROMs and hardware monitoring chips, to which > you never write blocks. Okay... so i've no chance to send the PIC block data. :'-( Thanks a lot! I give up. ;-) Nick __________________________________________________________ Gesendet von Yahoo! Mail. Dem pfiffigeren Posteingang. http://de.overview.mail.yahoo.com _______________________________________________ i2c mailing list i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org http://lists.lm-sensors.org/mailman/listinfo/i2c ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <968764.38783.qm-fkCdBXra523GRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org>]
* Re: i2c_smbus_write_block_data does not send all bytes?! [not found] ` <968764.38783.qm-fkCdBXra523GRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org> @ 2008-07-15 17:52 ` Jean Delvare 0 siblings, 0 replies; 13+ messages in thread From: Jean Delvare @ 2008-07-15 17:52 UTC (permalink / raw) To: xpage_de-LWAfsSFWpa4; +Cc: i2c-GZX6beZjE8VD60Wz+7aTrA On Tue, 15 Jul 2008 17:28:34 +0000 (GMT), Nick Teen wrote: > --- Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org> wrote: > > Which bus do you see the device on in i2cdetect? You said > > earlier that you were using the i2c-i801 driver, which is expected for > > an Intel motherboard. However you say that the PIC is connected to > > an SMSC chip, and not the Intel south bridge? Are you sure? If you are, > > what is the name of the SMSC chip in question? > > Okay, i was wrong. The smsc47m192 _and_ the PIC is connected to the > SMBus I801 (at a040). If i type "sensors", i get sensor data from 0x2d. > > > Which i2c bus are you running your program on? The > > "SMBus I801" one? > > I'm afraid so. > > > Note that it is not entirely impossible that the block > > write support in the i2c-i801 driver is broken. This is a driver which is > > mostly used to access SPD EEPROMs and hardware monitoring chips, to which > > you never write blocks. > > Okay... so i've no chance to send the PIC block data. :'-( > > Thanks a lot! I give up. ;-) This is free software. The i2c-i801 driver is open for you to look at, and the datasheets are also available for download from Intel. For example: http://www.intel.com/design/chipsets/datashts/252516.htm So if you are really motivated, you could compare what the code does for the block write transactions with what the datasheet says, and contribute the fix if you find something. -- Jean Delvare _______________________________________________ i2c mailing list i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org http://lists.lm-sensors.org/mailman/listinfo/i2c ^ permalink raw reply [flat|nested] 13+ messages in thread
* i2c_smbus_write_block_data does not send all bytes?!
@ 2008-07-15 7:29 Nick Teen
[not found] ` <180252.53613.qm-WQsacCdWWGLGRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org>
0 siblings, 1 reply; 13+ messages in thread
From: Nick Teen @ 2008-07-15 7:29 UTC (permalink / raw)
To: i2c-GZX6beZjE8VD60Wz+7aTrA
Hi Jean,
> You probably want to use i2c_smbus_write_i2c_block_data instead. With
> i2c_smbus_write_block_data, the first data byte isn't real data,
> instead in indicates how many bytes follow until the end of the block.
> It should result in "5D W 11 33 44" in your case though, not sure why
> you get "5D W 11 03 33" instead.
i'm aware of the length field and i2c_smbus_write_i2c_block_data doesn't work, too. Now i get: 5D W 11 44
unsigned char values[3];
int reg = 0x11;
values[0] = 0x33;
values[1] = 0x44;
i2c_smbus_write_i2c_block_data(fd, reg, 2, values);
If i change the third parameter (length) to 1 I get the 0x33.
I've no idea! :-(
Regards,
Nick
__________________________________________________________
Gesendet von Yahoo! Mail.
Dem pfiffigeren Posteingang.
http://de.overview.mail.yahoo.com
_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c
^ permalink raw reply [flat|nested] 13+ messages in thread[parent not found: <180252.53613.qm-WQsacCdWWGLGRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org>]
* Re: i2c_smbus_write_block_data does not send all bytes?! [not found] ` <180252.53613.qm-WQsacCdWWGLGRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org> @ 2008-07-15 7:47 ` Jean Delvare 0 siblings, 0 replies; 13+ messages in thread From: Jean Delvare @ 2008-07-15 7:47 UTC (permalink / raw) To: Nick Teen; +Cc: i2c-GZX6beZjE8VD60Wz+7aTrA Hi Nick, On Tue, 15 Jul 2008 07:29:56 +0000 (GMT), Nick Teen wrote: > > You probably want to use i2c_smbus_write_i2c_block_data instead. With > > i2c_smbus_write_block_data, the first data byte isn't real data, > > instead in indicates how many bytes follow until the end of the block. > > It should result in "5D W 11 33 44" in your case though, not sure why > > you get "5D W 11 03 33" instead. > > i'm aware of the length field and i2c_smbus_write_i2c_block_data doesn't > work, too. Now i get: 5D W 11 44 > > unsigned char values[3]; > int reg = 0x11; > values[0] = 0x33; > values[1] = 0x44; > i2c_smbus_write_i2c_block_data(fd, reg, 2, values); > > If i change the third parameter (length) to 1 I get the 0x33. Ah, you're in user-space, using i2c-dev? You should have told us so. > I've no idea! :-( I don't remember any similar problem, so no idea either. I can only suspect that your bus driver is doing something wrong. So please give us the detail of your setup: * Which version of i2c-dev.h are you using? * What architecture are you working on? * Which kernel version are you using? * What i2c bus driver are you using? * How do you know for sure what actually goes on the bus? -- Jean Delvare _______________________________________________ i2c mailing list i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org http://lists.lm-sensors.org/mailman/listinfo/i2c ^ permalink raw reply [flat|nested] 13+ messages in thread
* i2c_smbus_write_block_data does not send all bytes?!
@ 2008-07-14 20:32 Nick Teen
[not found] ` <247321.99325.qm-SFSZVIN0dfnGRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org>
0 siblings, 1 reply; 13+ messages in thread
From: Nick Teen @ 2008-07-14 20:32 UTC (permalink / raw)
To: i2c-GZX6beZjE8VD60Wz+7aTrA
[-- Attachment #1: Type: text/plain, Size: 410 bytes --]
Hello folks,
i despair of i2c_smbus_write_block_data. I try to send this few bytes:
5D W 11 02 33 44
but my attached example code sends always:
5D W 11 03 33
I'm perfectly happy if somebody can help me! :-)
King Regards,
Nick
__________________________________________________________
Gesendet von Yahoo! Mail.
Dem pfiffigeren Posteingang.
http://de.overview.mail.yahoo.com
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: write-values.c --]
[-- Type: text/x-csrc; name="write-values.c", Size: 895 bytes --]
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <linux/i2c-dev.h>
int main()
{
int fd;
int adapter_nr = 3; /* probably dynamically determined */
unsigned long addr = 0x5d; /* The I2C address */
char filename[20] = {0};
unsigned int size;
char buf[5] = {0};
int res;
int reg;
unsigned char values[3];
sprintf(filename,"/dev/i2c-%d",adapter_nr);
printf("device file: %s\n",filename);
printf("i2c device Address: 0x%x\n",addr);
fd = open(filename,O_RDWR);
res = ioctl(fd,I2C_SLAVE,addr);
reg = 0x11;
values[0] = 0x33;
values[1] = 0x44;
if ( i2c_smbus_write_block_data(fd, reg, 2, values) < 0) {
perror("Error: ");
}
close(filename);
return 0;
}
[-- Attachment #3: Type: text/plain, Size: 157 bytes --]
_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c
^ permalink raw reply [flat|nested] 13+ messages in thread[parent not found: <247321.99325.qm-SFSZVIN0dfnGRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org>]
* Re: i2c_smbus_write_block_data does not send all bytes?! [not found] ` <247321.99325.qm-SFSZVIN0dfnGRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org> @ 2008-07-14 20:54 ` Jean Delvare 0 siblings, 0 replies; 13+ messages in thread From: Jean Delvare @ 2008-07-14 20:54 UTC (permalink / raw) To: Nick Teen; +Cc: i2c-GZX6beZjE8VD60Wz+7aTrA Hallo Nick, On Mon, 14 Jul 2008 20:32:25 +0000 (GMT), Nick Teen wrote: > Hello folks, > > i despair of i2c_smbus_write_block_data. I try to send this few bytes: > > 5D W 11 02 33 44 > > but my attached example code sends always: > > 5D W 11 03 33 > > I'm perfectly happy if somebody can help me! :-) You probably want to use i2c_smbus_write_i2c_block_data instead. With i2c_smbus_write_block_data, the first data byte isn't real data, instead in indicates how many bytes follow until the end of the block. It should result in "5D W 11 33 44" in your case though, not sure why you get "5D W 11 03 33" instead. -- Jean Delvare _______________________________________________ i2c mailing list i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org http://lists.lm-sensors.org/mailman/listinfo/i2c ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2008-07-15 17:52 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-15 8:29 i2c_smbus_write_block_data does not send all bytes?! Nick Teen
[not found] ` <884255.29098.qm-WOTGQye7mknGRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org>
2008-07-15 10:57 ` Jean Delvare
[not found] ` <20080715125702.48c9569b-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-07-15 12:22 ` Nick Teen
[not found] ` <952972.59634.qm-WQsacCdWWGLGRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org>
2008-07-15 12:32 ` Jean Delvare
[not found] ` <20080715143258.2bef9c1e-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-07-15 13:02 ` Nick Teen
[not found] ` <732644.12112.qm-qWTMlLQujKzGRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org>
2008-07-15 13:13 ` Jean Delvare
[not found] ` <785052.52325.qm@web27604.mail.ukl.yahoo.com>
[not found] ` <785052.52325.qm-qWTMlLQujKzGRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org>
2008-07-15 16:52 ` Jean Delvare
[not found] ` <20080715185223.7f2f39aa-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-07-15 17:28 ` Nick Teen
[not found] ` <968764.38783.qm-fkCdBXra523GRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org>
2008-07-15 17:52 ` Jean Delvare
-- strict thread matches above, loose matches on Subject: below --
2008-07-15 7:29 Nick Teen
[not found] ` <180252.53613.qm-WQsacCdWWGLGRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org>
2008-07-15 7:47 ` Jean Delvare
2008-07-14 20:32 Nick Teen
[not found] ` <247321.99325.qm-SFSZVIN0dfnGRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org>
2008-07-14 20:54 ` Jean Delvare
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox