AW: [En-Nut-Discussion] I2C questions
Kowalsky, Richard
Richard.Kowalsky at fluke.com
Sun Jan 1 19:35:38 CET 2006
Andreas,
It works! Thank you very much for all your help. Just as you
suspected, I had the wrong address. (I forgot to take into account the
address being shifted over 1 bit). With your suggested code, below, I
saw the address that were really returning valid data and then when I
realized that they were shifted 1 bit from what I expected, everything
fell into place. All 4 I2C devices are now talking happily.
I definitely recommend that people use your test code if they are
turning on new hardware just as a double-check. I can save them lots of
time.
Thanks again for your help. I definitely owe you a beer!
Richard
-----Original Message-----
----------------------------------------------------------------
Hi Richard,
I forgot - maybe you use the wrong adress of your I2C devices ?
this a a very dirty piece of code to find resonding devices (active
adresses) by returncode rc
void TestTWI (void)
{
unsigned char lbuf[10];
unsigned char retb[10];
lbuf[0]=0xf0; // dummy
unsigned char a = 0;
int rc;
for(a=0; a<256; a++)
{
rc = TwMasterTransact(a, lbuf, 1, retb, 1, 1000);
printf("Adress : Dez: %d Hex: %02X RC:%d\n",a,retb[0],rc);
NutSleep(50);
}
Andreas
This message (including any attachments) contains confidential
and/or proprietary information intended only for the addressee.
Any unauthorized disclosure, copying, distribution or reliance on
the contents of this information is strictly prohibited and may
constitute a violation of law. If you are not the intended
recipient, please notify the sender immediately by responding to
this e-mail, and delete the message from your system. If you
have any questions about this e-mail please notify the sender
immediately.
Ce message (ainsi que les eventuelles pieces jointes) est
exclusivement adresse au destinataire et contient des
informations confidentielles. La copie, la communication ou la
distribution du contenu de ce message sans l'accord prealable de
l'expediteur sont strictement interdits et peuvent constituer un
delit. Si vous n'etes pas destinataire de ce message, merci de le
detruire et d'avertir l'expediteur. Si vous avez des questions se
rapportant a ce courrier electronique, merci de bien vouloir
notifier
l'expediteur immediatement.
_______________________________________________
En-Nut-Discussion mailing list
En-Nut-Discussion at egnite.de
http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
This message (including any attachments) contains confidential
and/or proprietary information intended only for the addressee.
Any unauthorized disclosure, copying, distribution or reliance on
the contents of this information is strictly prohibited and may
constitute a violation of law. If you are not the intended
recipient, please notify the sender immediately by responding to
this e-mail, and delete the message from your system. If you
have any questions about this e-mail please notify the sender
immediately.
Ce message (ainsi que les eventuelles pieces jointes) est
exclusivement adresse au destinataire et contient des
informations confidentielles. La copie, la communication ou la
distribution du contenu de ce message sans l'accord prealable de
l'expediteur sont strictement interdits et peuvent constituer un
delit. Si vous n'etes pas destinataire de ce message, merci de le
detruire et d'avertir l'expediteur. Si vous avez des questions se
rapportant a ce courrier electronique, merci de bien vouloir
notifier
l'expediteur immediatement.
More information about the En-Nut-Discussion
mailing list