EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

I2C simulator

Started by Wills April 12, 2009
Hi all,
 I want to learn 'how to program an I2C device' . I am trying to find
a simulator for an I2C device which I can use to test any sample
programs I get from the web. When I search the web for a simulator I
get a lot of VLSI related results. Is there a free I2C device
simulator software for learning I2C programming.
Thank in advance.
Wills wrote:

> I want to learn 'how to program an I2C device' . I am trying to find > a simulator for an I2C device which I can use to test any sample > programs I get from the web. When I search the web for a simulator I > get a lot of VLSI related results. Is there a free I2C device > simulator software for learning I2C programming.
I don't know, if there is a simulator, but the best would be to use a microcontroller and a real I2C device anyway. The protocol is easy and many microcontrollers have master and slave support, so you could even use 2 microcontrollers and test master/slave communication, but a real slave device, like the PCA9555, would be better, because then you can be sure that the slave protocol is implemented right. The interesting part for I2C is when the chips are stuck, e.g. some chip is holding SDA low all the time, because of a bad I2C implementation or EMC problems. This problem is so common that there are even chips which can detect a stuck I2C bus and which tries to recover it by hammering some pulses on SCL: http://www.linear.com/pc/productDetail.jsp?navId=H0,C1,C1007,C1070,P34332 This can be done in software on a microcontroller, too. -- Frank Buss, fb@frank-buss.de http://www.frank-buss.de, http://www.it4-systems.de
On Apr 12, 3:00=A0pm, Wills <wills.kingspan...@gmail.com> wrote:
> Hi all, > =A0I want to learn 'how to program an I2C device' . I am trying to find > a simulator for an I2C device which I can use to test any sample > programs I get from the web. When I search the web for a simulator I > get a lot of VLSI related results. Is there a free I2C device > simulator software for learning I2C programming. > Thank in advance.
The best simulator, is a real device, surely ? - and with a little real-world noise added, just to check error recovery of the system. It's not clear what will be running your 'i2c simulator', and how you expect to couple that to your Code-Under-Test - but i2c is 1MHz (and even 3.4MHz spec), so some physical HW is going to be much better at this, than SW alone. There are storage scopes, that can protocol decode i2c. -jg
In article <334b1843-d2af-4392-aa76-
e35ee77c04b7@y6g2000prf.googlegroups.com>, Jim.Granville@gmail.com=20
says...
> On Apr 12, 3:00=A0pm, Wills <wills.kingspan...@gmail.com> wrote: > > Hi all, > > =A0I want to learn 'how to program an I2C device' . I am trying to find > > a simulator for an I2C device which I can use to test any sample > > programs I get from the web. When I search the web for a simulator I > > get a lot of VLSI related results. Is there a free I2C device > > simulator software for learning I2C programming. > > Thank in advance. >=20 > The best simulator, is a real device, surely ? - and with a little > real-world noise added, just to check error recovery of the > system. >=20 > It's not clear what will be running your 'i2c simulator', and how you > expect > to couple that to your Code-Under-Test - but i2c is > 1MHz (and even 3.4MHz spec),=20
Base is 100kHz,=20 then 400kHz then 1MHz and 3.4MHz for diminishing numbers of devices The higher the speed the higher the requirement for hardware I2C controller, over software emulation to test/use at full=20 clock rate.
>so some physical HW is going to > be much better at this, than SW alone.
Better to test using actual device and digital scope to analyse timing problems, then other issues. =20
> There are storage scopes, that can protocol decode i2c.
Once the timing is correct. =20
> -jg
--=20 Paul Carpenter | paul@pcserviceselectronics.co.uk <http://www.pcserviceselectronics.co.uk/> PC Services <http://www.pcserviceselectronics.co.uk/fonts/> Timing Diagram Font <http://www.gnuh8.org.uk/> GNU H8 - compiler & Renesas H8/H8S/H8 Tiny <http://www.badweb.org.uk/> For those web sites you hate
Wills wrote:
> Hi all, > I want to learn 'how to program an I2C device' . I am trying to find > a simulator for an I2C device which I can use to test any sample > programs I get from the web. When I search the web for a simulator I > get a lot of VLSI related results. Is there a free I2C device > simulator software for learning I2C programming. > Thank in advance.
www.MCC-us.com www.totalphase.com beagle and the micro chip serial analyzer com to mind.

The 2024 Embedded Online Conference