Advanced Operating Systems The I 2 C Bus. Inter-Integrated Circuit Bus Designed for low-cost, medium data rate applications. Characteristics: –Synchronous;

Slides:



Advertisements
Similar presentations
I2C bus Inter Integrated Circuits bus by Philips Semiconductors
Advertisements

Dr. Rabie A. Ramadan Al-Azhar University Lecture 3
FPGA Configuration. Introduction What is configuration? – Process for loading data into the FPGA Configuration Data Source Configuration Data Source FPGA.
LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.
Chapter 2 HARDWARE SUMMARY
Embedded Systems I2CI2C. Feature 3 wire GND SCL(clock) SDA(data) All devices share the same bus wire Using wire and, each device gain access to bus (become.
Serial Interfaces, Part Deux -I 2 C and SPI December 4, 2002 Presented by Eugene Ho.
University of Pennsylvania 1 The BASIC Stamp 2. University of Pennsylvania 2 The BASIC Stamp 2 Serial Signal Conditioning Conditions voltage signals between.
Technion Digital Lab Project Xilinx ML310 board based on VirtexII-PRO programmable device Students: Tsimerman Igor Firdman Leonid Firdman Leonid.
© 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Networking for Embedded Systems zWhy we use networks. zNetwork abstractions. zExample.
7-1 Digital Serial Input/Output Two basic approaches  Synchronous shared common clock signal all devices synchronised with the shared clock signal data.
Getting the O in I/O to work on a typical microcontroller Activating a FLASH memory “output line” Part 1 Main part of Laboratory 1 Also needed for “voice.
1 ECE 263 Embedded System Design Lessons 2, 3 68HC12 Hardware Overview, Subsystems, and memory System.
Configuration. Mirjana Stojanovic Process of loading bitstream of a design into the configuration memory. Bitstream is the transmission.
I2CI2C CS-423 Dick Steflik. Inter-Integrated Circuit Developed and patented by Philips for connecting low speed peripherals to a motherboard, embedded.
Two Wire Interface Another popular serial peripheral interface bus -More flexible than SPI -Master and slave modes supported -7-bit slave address -400khz.
The 8051 Microcontroller Architecture
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.
Interfaces A practical approach. Lesson 2 I2C and SPI
1 EECS 373 Design of Microprocessor-Based Systems Prabal Dutta University of Michigan Lecture 10: Serial buses Oct 6, 2011.
SERIAL BUS COMMUNICATION PROTOCOLS
Microprocessor Block Diagram
Serial Peripheral Interface (SPI) Bus. SPI Bus There is no official specification for the SPI bus. It is necessary to consult the data sheets of the devices.
CS-280 Dr. Mark L. Hornick 1 Parts of a GP Computer (Microcomputer) Contains separate Microprocessor chip Memory/Memory controller MB control chips Peripheral.
Critical Design Review 27 February 2007 Black Box Car System (BBCS) ctrl + z: Benjamin Baker, Lisa Furnish, Chris Klepac, Benjamin Mauser, Zachary Miers.
LSU 10/22/2004Serial I/O1 Programming Unit, Lecture 5.
4.0 rtos implementation part II
Objectives How Microcontroller works
UART and UART Driver B. Ramamurthy.
1 SERIAL PORT INTERFACE FOR MICROCONTROLLER EMBEDDED INTO INTEGRATED POWER METER Mr. Borisav Jovanović, Prof.dr Predrag Petković, Prof.dr. Milunka Damnjanović,
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
Lecture 20: Communications Lecturers: Professor John Devlin Mr Robert Ross.
DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK
ECS642U Embedded Systems Digital I/O William Marsh.
Interrupts, Buses Chapter 6.2.5, Introduction to Interrupts Interrupts are a mechanism by which other modules (e.g. I/O) may interrupt normal.
PCA9557: REMOTE 8-BIT I 2 C AND SMBus LOW- POWER I/O EXPANDER.
MICROCONTROLLER SYSTEMS Part 1. Figure 1.1Elements of a digital controller CPU Central Processing Unit Input Peripherals Output Peripherals ROM Read Only.
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.
ECS642U Embedded Systems Cyclic Execution and Polling William Marsh.
ATtiny23131 A SEMINAR ON AVR MICROCONTROLLER ATtiny2313.
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.
Essentials of Communication This simple model requires many guarantees. Sender Receiver Communication Link Data.
CSCI1600: Embedded and Real Time Software Lecture 16: Advanced Programming with I/O Steven Reiss, Fall 2015.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction Purpose  This course provides an introduction to the peripheral functions.
Embedded Communication Protocols Don Heer 10/18/10 1.
Modified Harvard architecture 8-bit RISC single chip microcontroller Complete System-on-a-chip On Board Memory (FLASH, SRAM & EEPROM) On Board Peripherals.
میکرو کنترلرهای AVR Serial Interfaces, I2C and SPI
MICROCONTROLLER AND INTERFACING Presented by: Shefali Jethva ( ) Shivali Panchal ( ) Komal Soni ( ) Roll no. :- 14EC308.
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.
UNIT 24 I2C Test 로봇 SW 교육원 조용수.
Chapter 6 Input/Output Organization
Outline Analog to digital conversion (ADC) of NuMaker TRIO
The I2C Bus.
Chapter 11: Inter-Integrated Circuit (I2C) Interface
(Inter-IC bus) By Tejaswini Gadicherla
UART and UART Driver B. Ramamurthy.
EE 107 Fall 2017 Lecture 7 Serial Buses – I2C Direct Memory Access
I2C Synchronous Serial Two wire communications (plus ground)
Dr. Michael Nasief Lecture 2
I2C Protocol and RTC Interfacing
I2C PROTOCOL SPECIFICATION
The Arduino Microcontroller: Atmel AVR Atmega 328
Zephyr Device Driver and Device Model
EEPROM Comparison – Parallel or Serial
UART and UART Driver B. Ramamurthy.
I2C Protocol and RTC Interfacing
Presentation transcript:

Advanced Operating Systems The I 2 C Bus

Inter-Integrated Circuit Bus Designed for low-cost, medium data rate applications. Characteristics: –Synchronous; – serial; –multiple-master; –fixed-priority arbitration. Several microcontrollers come with built-in I 2 C controllers. –PC based version is called SMBus I 2 C bus

I 2 C physical layer master 1master 2 slave 1slave 2 SCL SDL data line clock line

I 2 C data format SCL SDL... MSBstart... ack...

I 2 C electrical interface SDL + SCL +

I 2 C signaling Sender pulls down bus for 0. Sender listens to bus---if it tried to send a 1 and heard a 0, someone else is simultaneously transmitting. Transmissions occur in 8-bit bytes.

I 2 C data link layer Every device has an address (7 bits in standard, 10 bits in extension). –Bit 8 of address signals read or write. General call address allows broadcast.

I 2 C bus arbitration Sender listens while sending address. When sender hears a conflict, if its address is higher, it stops signaling. Low-priority senders relinquish control early enough in clock cycle to allow bit to be transmitted reliably.

I 2 C transmissions multi-byte write read from slave write, then read Sadrs0data P Sadrs1dataP Sadrs0dataSadrs1dataP

I2C on the Puppeteer I2C is used on the puppeteer board Used to control VNRAM on an EEPROM –ATMEL AT24C02AN Also used for clock RTC-8563SA/JE Has two external connection – via liberator connector & via the expansion socket at the end of the board The BSP use I 2 C for setting up the boards setting – user access is through config and config commit

I 2 C on the Puppeteer The use of I 2 C on the Puppeteer is instructive The onboard eeprom holds non-volatile data –Boot settings –Default uarts –Ethernet MAC address –FPGA set up code base address Why not use Flash?

I 2 C on the Puppeteer The SDA and SCL lines are connected through the StrongARM’s General Purpose IO lines –SDA 15 –SDC 14 There is some set up required to make sure that these pins are for this dedicated function.

#define GPIO_BASE 0x struct gpioreg { int gplr; // R int gpdr; // RW int gpsr; // W int gpcr; // W int grer; // RW int gfer; // RW int gedr; // RW int gafr; // RW }; /* * I2C data (SDA) and clock (SCL) lines. craig */ #define BIT1 0x02 #define BIT14 0x4000 #define BIT15 0x8000 #define I2C_SDA BIT14 /* GPIO 14 */ #define I2C_SCL BIT15 /* GPIO 15 */

* * FUNCTION NAME : Init * ARGUMENTS : I2CLineDriver_t* pThis - Pointer to driver. * RETURNS : - * DESCRIPTION : Initialises hardware related to the * : I2C data and clock lines. * */ static void Init( I2CLineDriver_t* pThis) { volatile struct gpioreg* pGPIORegs = (volatile struct gpioreg*)GPIO_BASE; /************************************************ * * Check arguments. * ***********************************************/ if (!pThis) return; /************************************************ * * Return if routine has already been called. * ***********************************************/

if (pThis->bInitialised) return; /************************************************ * If required, configure the I2C clock and * data pins as GPIO lines in the alternate * function register (GAFR) ***********************************************/ if (I2C_SCL > BIT1) pGPIORegs->gafr &= ~(I2C_SCL); if (I2C_SDA > BIT1) pGPIORegs->gafr &= ~(I2C_SDA); /************************************************ * Initially set the pins up as inputs (no drive * from CPU, hence should be pulled high by the * external resistors). ***********************************************/ pGPIORegs->gpdr &= ~(I2C_SCL | I2C_SDA); /************************************************ * Set the initialised flag. * ***********************************************/ pThis->bInitialised = TRUE; } /* end Init */

* * FUNCTION NAME : GetData * ARGUMENTS : I2CLineDriver_t* pThis - Pointer to driver. * RETURNS : - * DESCRIPTION : Returns the state of the I2C data line. * */ static BOOL GetData(I2CLineDriver_t* pThis) { volatile struct gpioreg* pGPIORegs = (volatile struct gpioreg*)GPIO_BASE; if (!pThis) return FALSE; /************************************************ * Ensure that the driver has been initialised. ***********************************************/ if (!pThis->bInitialised) pThis->Init(pThis); /************************************************ * Configure the I2C data line as an input. ***********************************************/ pGPIORegs->gpdr &= ~(I2C_SDA); /************************************************ * Sample the data line. ***********************************************/ if (pGPIORegs->gplr & I2C_SDA) return TRUE; else return FALSE; } /* end GetData */