Chapter 11: Inter-Integrated Circuit (I2C) Interface

Slides:



Advertisements
Similar presentations
IO Interfaces and Bus Standards. Interface circuits Consists of the cktry required to connect an i/o device to a computer. On one side we have data bus.
Advertisements

I2C bus Inter Integrated Circuits bus by Philips Semiconductors
Serial Interfaces, Part Deux -I 2 C and SPI December 4, 2002 Presented by Eugene Ho.
680XX Hardware Interface Outline Goal Reading
I2CI2C CS-423 Dick Steflik. Inter-Integrated Circuit Developed and patented by Philips for connecting low speed peripherals to a motherboard, embedded.
Lecture 27: LM3S9B96 Microcontroller – Inter- Integrated Circuit (I 2 C) Interface.
Haptic Belt team Informational Presentation.  I 2 C is a form of control bus (multi-master) which allows communication between multiple integrated circuits.
Serial Peripheral Interface Module MTT M SERIAL PERIPHERAL INTERFACE (SPI)
Lecture 111 Lecture 11: Lab 3 Overview, the ADV7183B Video Decoder and the I 2 C Bus ECE 412: Microcomputer Laboratory.
LSU 10/22/2004Serial I/O1 Programming Unit, Lecture 5.
Input/Output mechanisms
7/23 Inter-chip Serial Communication: SPI and I 2 C Computer Science & Engineering Department Arizona State University Tempe, AZ Dr. Yann-Hang Lee.
1 SERIAL PORT INTERFACE FOR MICROCONTROLLER EMBEDDED INTO INTEGRATED POWER METER Mr. Borisav Jovanović, Prof.dr Predrag Petković, Prof.dr. Milunka Damnjanović,
MICROPROCESSOR INPUT/OUTPUT
DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK
(More) Interfacing concepts. Introduction Overview of I/O operations Programmed I/O – Standard I/O – Memory Mapped I/O Device synchronization Readings:
PCA9557: REMOTE 8-BIT I 2 C AND SMBus LOW- POWER I/O EXPANDER.
1 Synchronous Serial IO Send a separate clock line with data –SPI (serial peripheral interface) protocol –I 2 C (or I2C) protocol Encode a clock with data.
Refer to Chapter 15 in the reference book
©2008 R. Gupta, UCSD COSMOS Summer 2008 Peripheral Interfaces Rajesh K. Gupta Computer Science and Engineering University of California, San Diego.
© 2009, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose:  This course provides an overview of the serial communication.
Communicating. The ATmega16 communicates through one of the following ways: Serial Peripheral Interface (SPI) Universal Synchronous and Asynchronous serial.
Memory Interface EEE 365 [FALL 2014] LECTURER 12 ATANU K SAHA BRAC UNIVERSITY.
Lab 9 Multiprocessor, Buses, SPI, I2C. Multiprocessors Why multiprocessors? The structure of multiprocessors. Elements of multiprocessors: – Processing.
 The LPC2xxx devices currently have two on- chip UARTS.  Except UART1 has additional modem support.
The HCS12 SCI Subsystem A HCS12 device may have one or two serial communication interface. These two SCI interfaces are referred to as SCI0 and SCI1. The.
Interconnection Structures
Chapter 6 Input/Output Organization
Serial mode of data transfer
Outline Analog to digital conversion (ADC) of NuMaker TRIO
Basic Computer Organization and Design
COURSE OUTCOMES OF Microprocessor and programming
The 8085 Microprocessor Architecture
Environment Temperature Monitor
Serial Communication Buses: I2C and SPI
The I2C Bus.
Two Wire Interface Another popular serial peripheral interface bus
EE 107 Fall 2017 Lecture 5 Serial Buses – UART & SPI
Inter-IC Bus (I C) 2.
UNIT – Microcontroller.
I/O Memory Interface Topics:
(Inter-IC bus) By Tejaswini Gadicherla
1 Input-Output Organization Computer Organization Computer Architectures Lab Peripheral Devices Input-Output Interface Asynchronous Data Transfer Modes.
EE 107 Fall 2017 Lecture 7 Serial Buses – I2C Direct Memory Access
8085 Microprocessor Architecture
E3165 DIGITAL ELECTRONIC SYSTEM
I2C PROTOCOL SPECIFICATION
Communication Lines Fundamentals.
..
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
BJ Furman ME 106 Fundamentals of Mechatronics 15NOV2012
EEPROM Comparison – Parallel or Serial
Computer Organization and Design
Introduction to Microprocessors and Microcontrollers
Internet-of-Things (IoT)
Interfacing Memory Interfacing.
AT91 Memory Interface This training module describes the External Bus Interface (EBI), which generatesthe signals that control the access to the external.
Serial Communication Interface: Using 8251
Serial EEPROM (Atmel 24C-512)
Parallel communication interface 8255
I2C and RTC Chapter 18 Sepehr Naimi
I2C Protocol and RTC Interfacing
8085 Microprocessor Architecture
Overview of Computer Architecture and Organization
X1 & X2 These are also called Crystal Input Pins.
Overview of Computer Architecture and Organization
CHAPTER SERIAL PORT PROGRAMMING. Basics of Serial Communication Computers transfer data in two ways: ◦ Parallel  Often 8 or more lines (wire.
Serial Communication 19th Han Seung Uk.
William Stallings Computer Organization and Architecture
Presentation transcript:

Chapter 11: Inter-Integrated Circuit (I2C) Interface

The I2C Protocol Developed by Philips in late 1980s Version 1.0 was published in 1992. This version supports standard (100 Kbps) and fast (400 Kbps) mode. Version 2.0 was published in 1998. The high-speed mode (3.4 Mbps) was added. Classifies devices into slave and master Allow multiple masters to be attached to the same bus The master device uses either a 7-bit or 10-bit address to specify the slave device as its partner of data communication. Supports bi-directional data transfer Allow multiple masters (microcontrollers) to share the same peripheral devices I2C Signal Level Float high and driven low Use the SCL signal to carry clock signal to synchronize data transfer Use the SDA signal to carry data and address The SDA and SCL pins of I2C devices (masters and slaves) are open-drain and need external pull up resistors The resistors 2.2 KW and 1 KW are recommended for 100 kbps and 400 kbps baud rate.

Signal Components I2C data transfer consists of 5 signal components: (a) Start (S) (b) Stop (P) (c) Repeated Start (R) (d) Data (e) Acknowledge (A) Start Condition Used to indicate that a device would like to transfer data on the I2C bus Represented by the SDA line going low when the clock (SCL) signal is high Will initialize the I2C bus

Stop Condition A condition that a device wants to release the I2C bus Is represented by the SDA signal going high when the SCL signal is high Once the stop condition is complete, both the SCL and SDA signals are high. This is the idle bus.

Repeated Start (R) Condition - A Start signal generated without first generating a Stop condition to terminate the communication - Used by the master to communicate with another slave or change data transfer direction without releasing the bus - Also referred to as Restart condition

Data Represents the transfer of eight bits of information Data on the SDA line is considered valid only when the SCL signal is high. When the SCL signal is low, data is allowed to change. The eight-bit data may be a control code, an address, or data.

Acknowledge (ACK) Condition Data transfer needs to be acknowledged either positively (A) or negatively (NACK). A device acknowledges a byte it received positively by bringing the SDA line low during the ninth clock pulse of SCL. If the device allows the SDA line to float high, it is transmitting a negative acknowledge (NACK).

Arbitration In the event two or more master devices attempt to begin a transfer at the same time, an arbitration scheme is employed to force one or more masters to give up the bus. The master devices continue to transmit data until one master attempt to send a high while the other transmits a low. Since the SDA bus has open drain, the master device that attempts to send a high will detect a low. At this point, it will stop driving the bus. The arbitration process does not slow down the winning master’s transfer and no data gets lost.

I2C Addressing Methods I2C protocol allows master devices to use either the 7-bit and 10-bit address to specify the slave device for data communication. The 7-bit addressing uses the upper 7 bits of the address byte for address and the least significant bit to specify the data transfer direction. The format is shown in Figure 11.13. The 10-bit addressing uses two bytes to carry the address information. (a) The bit 0 of the high byte is used to indicate the data transfer direction. (b) The upper 7 bits have the pattern of 1111 0xx with xx representing the most significant two address bits of the slave. (c) The second byte carries the lower 8 address bits.

Data Transfer Format (7-bit addressing) Master transmitter to slave receiver – shown in Figure 11.10. Master reads slave immediately after the first byte (address byte) – shown in Figure 11.11. Combined format. A master may transfer some data to the slave and then generate a restart condition to read data from the slave or send/read data to/from other slave. -- shown in Figure 11.12.

An Overview of the HCS12 I2C Module The HCS12 I2C implements a subset of the I2C protocol. Provides interrupts on start and stop bits in hardware to determine if the I2C bus is free. Supports only 7-bit addressing Supports 100 kbps baud rate but requires the user to limit the slew rate to no higher than 100 ns if the 400 kbps baud is to be used. Limit the maximum bus capacitance to 400 pF for all conditions. Use PJ7 (SCL) and PJ6 (SDA) pins to support the I2C communication. Use 5 registers to support its operation: (a) I2C Control Register (IBCR) (b) I2C status Register (IBSR) (c) I2C data I/O register (IBDR) (d) I2C Frequency Divider Register (IBFD) (e) I2C Address Register (IBAD)

Registers for I2C Operation I2C Address Register (IBAD) Contains an address to which it will respond when the I2C module is configured as a slave device. I2C Data Register (IBDR) In master transmit mode, a data transfer is started whenever this register is written into. The most significant bit is shifted out first. In master receive mode, reading this register initiates the reception of the next byte (the master sends out 9 clock pulses to shift in data bits and replies with an acknowledge.)

The I2C Control Register

I2C Frequency Divider Register (IBFD) Four timing requirements to be met: (a) SCL divider (b) SDA hold time (c) SCL hold time for start condition (d) SCL hold time for stop condition

Digital Thermometer and Thermostat DS1631A Mainly used to warn the possible overheat of the embedded system to prevent system failure. When the ambient temperature exceeds the trip point, the DS1631A asserts the TOUT signal.

DS1631A converts temperature into 9-, 10-, 11-, or 12-bit readings over a range of -55oC to 125oC. TOUT is asserted whenever the converted ambient temperature is equal to or higher than the value stored in the TH register. Once asserted, the TOUT output will stay high until the temperature drops below the value stored in the TL register. Negative temperatures are represented in twos complement format. DS1631A Registers Config, TH, TL, and Temperature are DS1631A internal registers. The Config register is 8-bit. The Config register can be read from and written into. TH, TL, and Temperature registers are 16-bit.

Converting the Conversion Result to temperature The conversion result cannot be higher than 0x7D00 or lower than 0xC900. A sample of temperature reading is shown in Table 11.8 . Positive Conversion Result Step 1 Truncate the lowest four bits. Step 2 Divide the upper 12 bits by 16. Negative Conversion Result Compute the twos complement of the conversion result. Truncate the lowest 4 bits. Step 3 Divide the upper 12 bits of the twos complement of the conversion result by 16.

DS1631A Command Set Start Convert T (0x51) Stop Convert T (0x22) Read Temperature (0xAA) Access TH (0xA1) Access TL (0xA2) Access Config (0xAC) Software POR (0x54) Circuit Connection

DS1631A Control Byte (Device ID) Example 11.10 Write a function to configure the DS1631A in Figure 11.34 to operate in continuous conversion mode and set the TOUT polarity to active high. Assume that the I2C has only one master and there is no possibility in getting bus collision. Solution: Call the openDS1631 function on the next slide with the configuration byte of 0xE0: ldab #$E0 jsr openDS1631

Serial EEPROM 24LC08B 1 KB capacity Divided into 4 blocks of 256 bytes I2C interface Baud rate 400 kbps Address input A2, A1, and A0 are not used