Sunday, May 24, 2009

Inter IC communications

When design board for embedded applications, very seldom we are lucky that we only require to use one IC that able to meet our requirement. Most of the time, we need to use several IC and these IC need to communicate between one and another.How does it communicate ?

What we learn from data communications class, communications are either serial or parallel.
I'm not gonna explain how each types works, because you could also read it from wikipedia.
I basically will explain several standard that usually use in embedded design.

Serial
Serial are basically for low speed communications. Typical example is use when communicate with EEPROM IC, digital potential meter, low speed ADC & DAC, PLL, etc. Common standard for serial is

I²C
This is standard develop by philips and widely use in a lot of applications. It only require 2 wire for biderectional (half duplex) data transfer and can have communicatins of single master and multiple slave. Slave is addresable using 7bit, slave addrees. Typical speed is around 100kbits/sec and go also go up to 400kbits/sec. I've once develop a device that generate I²C signal to control a PLL IC inside a tv tuner. Inside Linux kernel already have the driver for I2C. You could go to http://www.i2cbus.com/ to look for the standard or wiki it for more detail explaination.

SPI, Serial Perihperal Interface
This standard is develop by motorola and widely use also like the I2C. The main advantage over I²C is it offer full duplex com,unications. But it use more wire, minimum 4 for duplex communications. It also master-slave communications but to add slave need to add extra CS (chip select line).

I2S & AC97
This standard is common use for audio applications (codec). It is use to transport PCM data between codec.

Parallel

Parallel communications are much faster than serial. Because it is parallel, it use more line for data transfer and take up more space on the PCB.

I/O bus
When we talk about I/O bus it can be both memory and normal I/O. For memory device like SDRAM, it communicate with the SDRAM controller which has it own spec. Other I/O device like the SRAM, UART, RTC usually communicate what is call I/O bus. I/O bus come into 2 variants:- Intel style or Motorola style. Both style can be interoperate by applying some simple logic. Most of my work, I use Intel style but I learn Motorola style using my study.
Many device can communicate sharing the same bus but the I/O address must be configured early during installation. If you look at "device manager" inside windows, go to COM1 or LPT1 properties, you will see their base address, such as 0x378. If you change the number, the device wont work because the address decoder inside the device already set to acknowledge that address. There's no spec on how big the address space or how big the data bus but usally either 8bit or 16bit.

PCI
PCI device was develop to replace ISA bus. As a replacement for ISA, it must be faster and solve the base address configurations issue. PCI bus communicate at 33Mhz clock minimum on 32bit/64bit address bus. The 33Mhz, 32bit can give data rate of 132Mbytes/sec. It has plug and play capability, meaning that the base address is assign at during the bootup of the sysem. Detail spec and implementation of the bus is widely available on the net.

No comments: