I2C simulator

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.

Reply to
Wills
Loading thread data ...

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:

formatting link

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
Reply to
Frank Buss

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

Reply to
-jg

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.

Better to test using actual device and digital scope to analyse timing problems, then other issues. =20

Once the timing is correct. =20

--=20 Paul Carpenter | snipped-for-privacy@pcserviceselectronics.co.uk PC Services Timing Diagram Font GNU H8 - compiler & Renesas H8/H8S/H8 Tiny For those web sites you hate

Reply to
Paul Carpenter

formatting link
formatting link
beagle and the micro chip serial analyzer com to mind.

Reply to
Neil

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.