Répondre au commentaire

Answers to some of your questions :-)

It is possible to run I2C (or TWI as Atmel calls it - I2C is a trademark of Philips/NXP) between 3V3 devices just as for 5V devices.
The iportant thing is that all devices on the bus have teh same Voltage level.
It is also possible to have a 3V3 and a 5V bus coupled together using a level shifter. In the TWI cas that would simply be two small FETs like the BSN20, one for each line (clock and data).

Imho it is *not* necessary to have the 5V lines of both devices on teh bus connected, a ground connection should be sufficient.
But a device powered down while on the bus may disturb the bus.

Optical isolation souinds like a good idea - but sadly it does not work with TWI as both signals, data and clock are bi-directional. This is very hard to buffer ot isolate.

The actual pull-up resistors used are sometime a bit critical.
The problem is, they must be as large and as small as possible at hte same time.
To elaborate: the smalles value for the resistors is defined by the ability of the bus devices to sink current. This is 20 mA for an AVR pin but may be a lot less for other devices like sensors.
so 5.5V / 20 mA = 275 Ohms - any smaller will fry the output in the AVR.
This value would make sure the bus charges up to a HIGH level (near 5V) very quickly, even when the capacitance of the bus is high.
Still, this would require a lot of power while communicating, so larger values for the resistors are desired.
But the larger the resistor value, teh less current will be available to charge the bus line to the HIGH level.

I found that values between 2k2 and 4k7 are usually good; if I get problems with communications, I lower the value to 1k or 470 Ohms if the devices allow for the current.

keep experimenting and posting!



Le contenu de ce champ ne sera pas montré publiquement.
  • Les adresses de pages web et de messagerie électronique sont transformées en liens automatiquement.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre> <h3> <h4> <h5> <h6>
  • Les lignes et les paragraphes vont à la ligne automatiquement.

Plus d'informations sur les options de formatage

Cette question permet de vérifier si vous êtes un visiteur humain afin d'empêcher les envois automatisés de pourriel.
Fill in the blank
By submitting this form, you accept the Mollom privacy policy.