I²C Protocol in microcontrollers

I²C (Inter-Integrated Circuit) (generically referred to as “two-wire interface”) is a multi-master serial single-ended computer bus invented by Philips that is used to attach low-speed peripherals to a motherboard, embedded system, or cellphone.

No licensing fees are required to implement the I²C protocol. However, fees are still required to obtain I²C slave addresses allocated by NXP.

I²C uses only two bidirectional open-drain lines, Serial Data Line (SDA) and Serial Clock (SCL), pulled up with resistors. Typical voltages used are +5 V or +3.3 V although systems with other voltages are permitted.

Maximum no of I2C UC ca be interfaced: 27=128, 16 reserved addresses, so a maximum of 112 nodes can communicate on the same bus.

Max. Communication Speed: 100 kbit/s standard mode and the 10 kbit/s low-speed mode, but arbitrarily low clock frequencies are also allowed. Recent revisions of I²C can host more nodes and run at faster speeds (400 kbit/s Fast mode, 1 Mbit/s Fast mode plus or Fm+, and 3.4Mbit/s High Speed mode). These speeds are more widely used on embedded systems than on PCs.

3 wire (SPI) Vs 2 wire (I²C):

I²C (for ‘Inter-Integrated Circuit’, protocol) and SPI (for ‘Serial Peripheral Interface’) both protocols are well-suited for communications between integrated circuits, for slow communication with on-board peripherals. At the roots of these two popular protocols we find two major companies – Philips for I²C and Motorola for SPI – and two different histories about why, when and how the protocols were created.

The I²C bus was developed in 1982; its original purpose was to provide an easy way to connect a CPU to peripherals chips in a TV set. Peripheral devices in embedded systems are often connected to the microcontroller as memory-mapped I/O devices. One common way to do this is connecting the peripherals to the microcontroller parallel address and data busses. This results in lots of wiring on the PCB (printed circuit board) and additional ‘glue logic’ to decode the address bus on which all the peripherals are connected. In order to spare microcontroller pins, additional logic and make the PCBs simpler – in order words, to lower the costs – Philips labs in Eindhoven (The Netherlands) invented the ‘Inter-Integrated Circuit’, IIC or I²C protocol that only requires 2 wires for connecting all the peripheral to a microcontroller.

It seems the Serial Peripheral Protocol (SPI) was first introduced with the first microcontroller deriving from the same architecture as the popular Motorola 68000 microprocessor, announced in 1979. SPI defined the external microcontroller bus, used to connect the microcontroller peripherals with 4 wires. Unlike I²C, it is hard to find a formal separate ‘specification’ of the SPI bus – for a detailed ‘official’ description, one has to read the microcontrollers data sheets and associated application notes.

 

Table: Advantages and Disadvantages of 3-/2-Wire Interfaces

Interface 

Advantages 

Disadvantages

3-Wire: SPI, QSPI, and MICROWIRE PLUS

1. Speed
2. No pullup resistors required
3. Full-duplex operation
4. Noise immunity

1. Larger number of bus line connections
2. Individual chip-select lines required to communicate with more than one slave at a time
3. No acknowledgment of received data

2-Wire: I²C and SMBus 

1. Fewer bus line connections
2. Multiple devices share the same bus
3. Received data is acknowledged

1. Speed: SMBus limited to 100kHz; I²C limited to 3.4MHz
2. Half-duplex operation
3.
Open-drain bus lines require pullup resistors
4. Reduced noise immunity


A master and a slave communicate through multiple bus lines over a 
serial interface. During a write cycle, the master uses its own clock and data signals to transmit data to the slave. During a read cycle, the slave transmits data to the master.

External Links:

http://www.esacademy.com/en/library/technical-articles-and-documents/miscellaneous/i2c-bus.html

http://www.eetimes.com/discussion/beginner-s-corner/4023816/Introduction-to-I2C

Measuring and analyzing I²C signals

SPI/I²C Bus Lines Control Multiple Peripherals AN4024

http://www.byteparadigm.com/kb/article/AA-00255/0/Introduction-to-SPI-and-IC-protocols.html

 

http://www.jcontrol.org/tutorials/comm_i2c/index_en.html

http://www.mikroe.com/eng/chapters/view/7/chapter-6-serial-communication-modules/

http://gsmukund.org/articles/i2c/i2c.html

 

 

Introduction to Pattern Recognition

a

“Pattern recognition is the research area that studies the operation and design of systems that recognize patterns in data. It encloses subdisciplines like discriminant analysis, feature extraction, error estimation, cluster analysis (together sometimes called statistical pattern recognition), grammatical inference and parsing (sometimes called syntactical pattern recognition).              .

… Pattern Recognition Group at Delft University of Technology

description of their research area.

“A branch of artificial intelligence concerned with the classification or description of observations. Pattern recognition aims to classify data (patterns) based on either a priori knowledge or on statistical information extracted from the patterns. The patterns to be classified are usually groups of measurements or observations, defining points in an appropriate multidimensional space.”   …. FOLDOC

Pattern recognition is the assignment of some sort of output value (or label) to a given input value (or instance), according to some specific algorithm. An example of pattern recognition is classification, which attempts to assign each input value to one of a given set of classes (for example, determine whether a given email is “spam” or “non-spam”).

Source: wikipedia

Pattern Recognition / Pattern Matching are not same.Pattern recognition algorithms generally aim to provide a reasonable answer for all possible inputs and to do “fuzzy” matching of inputs. This is opposed to pattern matching algorithms, which look for exact matches in the input with pre-existing patterns.

f