Wiring Forum
http://wiring.org.co/cgi-bin/yabb/YaBB.pl
Programming Questions & Help >> Integration >> I2C communication with wiring
http://wiring.org.co/cgi-bin/yabb/YaBB.pl?num=1268673068

Message started by ijmbarr on 03/15/10 at 17:11:08

Title: I2C communication with wiring
Post by ijmbarr on 03/15/10 at 17:11:08
Hi

I'm currently trying to use wiring and a JX-Mega128 board to communicate with a AD5667 DAC( http://www.analog.com/static/imported-files/data_sheets/AD5627R_5647R_5667R_5627_5667.pdf).

To do this I was planning to use the two wire library. I don't currently have the DAC, and am viewing the output of the SCL (pin 0) and SDA(pin 1) on an oscilloscope. It looks like the clock pulse from the board are at around 20MHz, much higher than the 100kHz or 400kHz supported by the DAC.

My questions are: Is this how fast the clock pulse should be? If so can I reduce the rate? And how exactly does the command Wire.send(x) work in terms of sending data to the I2C device?

I've had a look at the examples, but they seem to deal with how to use the Wire commands rather that what these commands are doing in terms of communicating with the device.

Any help would be appreciated.
Thanks
Iain

Title: Re: I2C communication with wiring
Post by barragan on 03/16/10 at 05:29:20
in general this is controlled using appropriate delays in critical points, or wait until a reading is done etc. Check out this example: http://wiring.org.co/learning/libraries/hmc6352sparkfun.html
or this one: http://wiring.org.co/learning/libraries/ultrasonicsfr.html

Title: Re: I2C communication with wiring
Post by ijmbarr on 03/16/10 at 10:25:47
It was a problem at my end and is fixed now.

Thanks
Iain

Title: Re: I2C communication with wiring
Post by barragan on 03/16/10 at 15:32:13
Could you make an example with your sensor for the examples section? I will help with the diagrams.

Wiring Forum » Powered by YaBB 2.5 AE!
YaBB Forum Software © 2000-2010. All Rights Reserved.