I2C

From CunningWiki
Jump to: navigation, search

Description

Voltages

RS232 specification says that the voltages may be ±25V, however ±5 V, ±10 V, ±12 V, and ±15 V are all common.

A 1 is represented as -3V to -25V

A 0 is represented as 3V to 25V

The voltages between -3V to 3V are considered invalid.


Common digital electronics do not support the true ±25V. Most electronics are much lower voltages like 2.7V to 6V. They must use transceivers to convert from the low TTL levels (transistor transistor logic) that microprocessor are capable of to the higher voltages required by a true RS232 device.

I2C Pull Ups

Common I2C Data Rates

Rates Frequency
Standard 100 kHz
Fast Mode (Fm) 400 kHz
High-speed Mode (Hs) 3.4 MHz
Fast Mode Plus (Fm+) 1 MHz
Ultra Fast Mode (UFm) 5 MHz

I2C Timing Diagrams

I2C data is measured at the high clock cycles of the I2C CLK signal. Below is a timing diagram.

Testing: Rise/Fall Time

Rise time: characterized as the time required for the voltage to step from the voltage low signal to a voltage high signal. Typically this is 10% and 90% of the voltage high signal.


Fall time: characterized as the time required for the voltage to step from the voltage high signal to the voltage low signal. Typically this is 90% and 10% of the voltage high signal.


In I2C communication the I2C receivers will have an acquisition at the middle of each bit. A fast rise time will mean that there is more margin in each bit for a correct acquisition. A slow rise or fall time will could mean that the bit is sampled during the rise transition which may be below the voltage input high voltage. Resulting in a false reading.

Testing: VIH/VIL

Voltage Input Low (VIL): The voltage threshold where the voltage input is considered low


Voltage Input High (VIH): The voltage threshold where the voltage input is considered high

Testing: Max Baud Rate

Testing every baud rate on every interface will take a lot of time. In some cases all you want to test is the Max Baud rate since it is the one that will be most affected due to shorter bits.


Testing: Baud Rate Accuracy

I use this reference to help understand baud rate accuracy. Generally speaking you want better than +/-2.5% accuracy for your transceivers or receivers.

Due to the crystal or oscillator used certain baud rates cannot even be achieved.

Generally the best way to measure this is to take a scope trace of a UART frame. A UART Frame is characterized as a Start Bit, Data and a Stop Bit. In a 8 bit frame this could look like this.

START BIT D0 D1 D2 D3 D4 D5 D6 D7 END BIT

In this frame there are 10 data bits (including the start and end bit). If we measured the time from the start bit leading edge to the stop bit trailing edge we could see 1041.7us. Since that is a measurement of 10 bits we divide by ten and each bit is 104.17us. 1/(0.00010417s) = 9599.69 Baud which is 99.9968% accurate to 9600 baud.


References

Maxim-IC Baud Rate Accuracy Signal Levels