Programación I2C En Pic

Páginas: 9 (2063 palabras) Publicado: 14 de diciembre de 2012
►What is I2C?

In modern electronic systems there are a number of peripheral ICs that have to communicate with each other and the outside world. To maximize hardware efficiency and simplify circuit design, Philips developed a simple bi-directional 2-wire, serial data (SDA) and serial clock (SCL) bus for inter-IC control. This I2C-bus supports any IC fabrication process and, with the extremelybroad range of I2C-compatible chips from Philips and other suppliers, it has become the worldwide industry standard proprietary control bus. Each device is recognized by a unique address and can operate as either a receiver-only device (e.g. an LCD Driver) or a transmitter with the capability to both receive and send information (such as memory). Transmitters and/or receivers can operate in eithermaster or slave mode, depending on whether the chip has to initiate a data transfer or is only addressed. I2C is a multi-master bus, i.e. it can be controlled by more than one IC connected to it. The basic I2C-bus, with a data transfer rate up to 100 kbits/s and 7-bit addressing, was originally introduced nearly 20 years ago. But, as data transfer rates and application functionality rapidlyincreased, the I2C-bus specification was enhanced to include Fast-mode and 10-bit addressing, meeting the demand for higher speeds and more address space. Most recently, High-speed Mode has been added; with speeds of up to 3.4 Mbits/s it ensures the capacity of the I2C-bus to support existing and future high speed serial transfer rates for applications such as EEPROM and Flash memory.

►I2C BusSpecification and Concept
The I2C-bus supports any IC fabrication process (NMOS, CMOS, bipolar). Two wires, serial data (SDA) and serial clock (SCL), carry information between the devices connected to the bus. Each device is recognized by a unique address (whether it�s a microcontroller, LCD driver, memory or keyboard interface) and can operate as either a transmitter or receiver, depending on thefunction of the device. Obviously an LCD driver is only a receiver, whereas a memory can both receive and transmit data. In addition to transmitters and receivers, devices can also be considered as masters or slaves when performing data transfers (see Table 1). A master is the device which initiates a data transfer on the bus and generates the clock signals to permit that transfer. At that time, anydevice addressed is considered a slave.

Term Transmitter Receiver Master Slave Multi-Master Arbitration Synchronization

Description The device which sends the data to the bus. The device which receives the data from the bus. The device which initiates a transfer, generates clock signals and terminates a transfer. The device addressed by a master. More than one master can attempt to controlthe bus. Only one master can control the bus. Procedure to sync. the clock signal.

The I2C-bus is a multi-master bus. This means that more than one device capable of controlling the bus can be connected to it. As masters are usually micro-controllers, let's consider the case of a data transfer between two microcontrollers connected to the I2C-bus (see figure above). 1) Suppose microcontroller Awants to send information to microcontroller B:

  

Microcontroller A (master), addresses microcontroller B (slave). Microcontroller A (master-transmitter), sends data to microcontroller B (slave-receiver). Microcontroller A terminates the transfer.

2) If microcontroller A wants to receive information from microcontroller B:

  

Microcontroller A (master) addressesmicrocontroller B (slave). Microcontroller A (master-receiver) receives data from microcontroller B (slave-transmitter). Microcontroller A terminates the transfer.

Generation of clock signals on the I2C-bus is always the responsibility of master devices; each master generates its own clock signals when transferring data on the bus. Bus clock signals from a master can only be altered when they are stretched...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • I2c en pic
  • Programación de Pic
  • programacion de pic
  • Pic programacion
  • Programacion En Pic C
  • Programación De Pic Para Seguidor
  • torreta, pic programacion
  • PROGRAMACIÓN DE PIC`s en MPLAB

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS