[En-Nut-Discussion] I2C questions

Kowalsky, Richard Richard.Kowalsky at fluke.com
Sat Dec 31 18:23:59 CET 2005


Hello All,

    I have a custom Mega128 based board and am using Enut 3.9.8. My
board has 2 - Max5821 I2C DAC's and 2 - Dallas DS1803 Digital
Potentiometers.  I have read the data sheets and the 128 manual but
still have some questions. I am trying to control them but have not had
any success yet.  The Mega128 will be the master.    If anyone can help,
I would really appreciate it.

    I know I need to call TwInit(addr) first to initialize the I2C bus,
but I am confused about the <addr> argument.  Can I just use any unused
address value?

    Next, I think I need to call TwIOCtl() to set the bus speed, but I
noticed that TwInit() already calls TwIOCtl() once so I am not sure if
this is really necessary.  If I do call TwIOCtl() and I want to run the
I2C buss at 100Khz, do I just literally pass 100,000 as the argument?

    Lastly, once I call TwInit() and TwIOCtl(), is that it?  From then
on, I just call TwMasterTransact() as needed?

    Sorry for the many questions, I think I am close but must be missing
one thing here or there.

    If anyone is willing to share any sample code, I would appreciate it
very much, if not, no problem.

Thanks in advance,
Richard




       

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