I2C BUS SERIAL EEPROM

Similar documents
Course on BASCOM AVR - (29) Theoretic/Practical course on BASCOM AVR Programming. Author: DAMINO Salvatore. SPI SERIAL EEPROM

Management of Optocoupled Input Lines.

K E Y B O A R D S (3).

SOFTWARE UART MANAGEMENT

Course on BASCOM AVR - ( 9 ) Theoretic/Practical course on BASCOM AVR Programming. Author: DAMINO Salvatore. MORSE CODE ( 3 ).

DT-SENSE. UltraSonic and InfraRed Ranger (USIRR)

Standard EEPROM ICs. Interfacing SLx 24Cxx I 2 C-Bus Serial EEPROMs to 8051 Controller Family, especially to the Siemens C500 Controller Family

DESIGNING OF INTER INTEGRATED CIRCUIT USING VERILOG

Lecture 25 March 23, 2012 Introduction to Serial Communications

SILICON MICROSTRUCTURES

Embedded Systems and Software. Serial Interconnect Buses I 2 C (SMB) and SPI

How to Implement I 2 C Serial Communication Using Intel MCS-51 Microcontrollers

The I2C BUS Interface

User s Guide. IP-201 I2C Bus Multiplexer Board Revision 1. Micro Computer Control Corporation

Tutorial for I 2 C Serial Protocol

Microcontrollers and Interfacing

Theory of Operation STOP CONDITION

Emulating I2C Bus Master by using FlexIO

Embedded Workshop 10/28/15 Rusty Cain

I2C a learn.sparkfun.com tutorial

Raspberry Pi - I/O Interfaces

Introduction the Serial Communications Parallel Communications Parallel Communications with Handshaking Serial Communications

White Paper Using the MAX II altufm Megafunction I 2 C Interface

Interfacing Techniques in Embedded Systems

Mercury System SB310

Implementation of MCU Invariant I2C Slave Driver Using Bit Banging

AW51V2, 8051 Development Board

Serial Buses in Industrial and Automotive Applications

Microcontroller Systems. ELET 3232 Topic 11: General Memory Interfacing

To be familiar with the USART (RS-232) protocol. To be familiar with one type of internal storage system in PIC (EEPROM).

Serial Peripheral Interface. What is it? Basic SPI. Capabilities. Protocol. Pros and Cons. Uses

IV B.Tech. I Sem (R13) ECE : Embedded Systems : UNIT -4 1 UNIT 4

Laboratory 5 Communication Interfaces

Brief Preface. INTRODUCTION

Part 1 Using Serial EEPROMs

DS WIRE INTERFACE 11 DECOUPLING CAP GND

2-Wire, 5-Bit DAC with Three Digital Outputs

I 2 C Application Note in Protocol B

Parallel Data Transfer. Suppose you need to transfer data from one HCS12 to another. How can you do this?

18-349: Introduction to Embedded Real-Time Systems

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING. EE Microcontroller Based System Design

RL78 Serial interfaces

TOP VIEW CLOCK GENERATOR A1 A2 GND CPU SPEED SELECT

17. I 2 C communication channel

Introduction to I2C & SPI. Chapter 22

Microcontroller Systems. ELET 3232 Topic 23: The I 2 C Bus

Basics of UART Communication

Interfacing the NM24C16 Serial EEPROM to the microcontroller. Interfacing the NM24C16 Serial EEPROM to the 8031 Microcontroller AN-957

Handson Technology. I2C Specification and Devices. 1

McMaster University Embedded Systems. Computer Engineering 4DS4 Lecture 6 Serial Peripherals Amin Vali Feb. 2016

Design and development of embedded systems for the Internet of Things (IoT) Fabio Angeletti Fabrizio Gattuso

THANG LUONG CAO. Serial bus adapter design for FPGA. Master of Science Thesis

Professional Development Board (#28138)

Microcontrollers and Interfacing week 10 exercises

Digital Storage Oscilloscope

BV4531U. I2C or Serial 6 Way Relay

Freescale Semiconductor, Inc.

Communication interfaces

THE INTERNATIONAL JOURNAL OF SCIENCE & TECHNOLEDGE

PCI to SH-3 AN Hitachi SH3 to PCI bus

1.3inch OLED User Manual

ORDERING INFORMATION. OPERATION Measuring Temperature A block diagram of the DS1621 is shown in Figure 1. DESCRIPTION ORDERING PACKAGE

DS1870 LDMOS BIAS CONTROLLER EV KIT

Microcomputer Architecture and Programming

I2C a learn.sparkfun.com tutorial

Section 16. Basic Sychronous Serial Port (BSSP)

MOS INTEGRATED CIRCUIT

Dallas Semiconductor DS1307 Real Time Clock. The DS 1307 is a real-time clock with 56 bytes of NV (nonvolatile)

Growing Together Globally Serial Communication Design In Embedded System

Embedded Development Platform

Using the Z8051 MCU s USI Peripheral as an SPI Interface

DS1676 Total Elapsed Time Recorder, Erasable

LCD Module with I2C / Serial Interface and Keypad Control «LCD I2C/Serial» User s Guide. Copyright 2008 IMS

DIGITAL HUMIDITY SENSOR HYT-131

GT34C02. 2Kb SPD EEPROM

Application Note. SLG46824/6 MTP Arduino Programming Example AN-CM-255

Fremont Micro Devices, Inc.

EE4380 Microprocessor Design Project

AN510 Using SPI protocol with pressure sensor modules

'Pressure_32 () calculates the air pressure with 32bit, it results in a resolution of 0.01hPa. 'This is quite sufficient for a weather station.

M3H Group(1) Application Note I 2 C Interface (I2C-B)

Development and research of different architectures of I 2 C bus controller. E. Vasiliev, MIET

DESIGN OF WISHBONE INTERFACED I2CMASTER CORE CONTROLLER USING VERILOG

FM24CL04 4Kb FRAM Serial Memory

AN-895 APPLICATION NOTE

ICN12. I2C to UART Bridge, ADC,DAC and I/O

JTAG and I 2 C on ELMB

Prototyping Module Datasheet

Using FlexIO to emulate communications and timing peripherals

AT24C01A/02/04/08/16. 2-Wire Serial CMOS E 2 PROM. Features. Description. Pin Configurations. 1K (128 x 8) 2K (256 x 8) 4K (512 x 8) 8K (1024 x 8)

Serial Communications

Microprocessors/Microcontrollers

AN-1159 APPLICATION NOTE

The Cubesat Internal bus: The I2C

GT24C02. 2-Wire. 2Kb Serial EEPROM (Smart Card application)

Chapter 6. Development of Microcontroller. based ECG system

Application Note 15 G X24C44 V CC DI DO

I2C interface Tutorial

Developing Reusable Device Drivers for MCU's

Serial Communications

Transcription:

Course on BASCOM 8051 - (30) Theoretic/Practical course on BASCOM 8051 Programming. Author: DAMINO Salvatore. I2C BUS SERIAL EEPROM In Embedded applications, among the most frequently used devices, there are the Serial EEPROM. These devices are available with different memory sizes, different packages and moreover with some, and different, Communication Protocols. In this chapter we ll descrive the I2C BUS Protocol. I2C BUS Logo The EEPROM are Memory, Not Volatile: this means that they mantains the stored information even without power supply. The devices can be written a very high number of times and they can be Read without limits, as standard RAM. The management operations are defined by accurate rules, that are described below. The internal structure is reported in the following Diagram that lists all the logic blocks included in the device. In order to get a detailed and bright vision of the device, we suggest You firstly to read and study the specific component Data Sheet and then to try the developed examples. 170

I 2 C B U S S E R I A L P R O T O C O L I2C stands for Inter Integrated Circuit (pronounced i-square-c o i-two-c), and it is a Doublewire Serial Communication system used between integrated circuits. The BUS has been developed by Philips in 1982 and, after the creation of hundreds of components and systems during the '80s, in 1992 has been released the first version of Protocol. It has been updated in different times and it has generated similar BUSes, too. One of these (named SM BUS) was developed only for commercial reasons and copyrighted by Intel, in 1995. The I2C BUS is composed by 2 lines named SDA (Serial DAta) and SCL (Serial Clock) and both them are open collector type. The SDA line is bidirectional and it allows data exchanges between the connected I2C device, viceversa SCL line is monodirectional and it is used as a Clock signal to sincronie the communication. This BUS, originally developed by Philips, is used in many different devices types even in commercial products. For example the serial EEPROM of 24Cxx family are widely diffused. The communication with an I2C component has some features applicable to each device. The begin and the end of I2C communication are always recognized by specific START and STOP conditions, sent on the BUS. These are obtained with defined sequences of logic states assigned to SDA and SCL lines. START and STOP on BUS In realesed conditions the SDA and SCL lines are mantained at logic level 1. The START sequence equal to a falling edge (from 1 to 0) on SDA line when SCL is mantained at level 1. Viceversa the STOP sequence equal to a rising edge (from 0 to 1) on SDA line while SCL is at level 1. SCL and SDA Signals During START and STOP 171

Once Start sequence has been generated the logic level of SDA line is considered valid, and it is read by I2C device when SCL is at level 1, viceversa when SCL is at level 0 each variations of SDA don t care. Data Transmission on BUS After start sequence, each data to send or receive from I2C BUS is composed by 8 bits (that is a byte), plus a nineth bit named ACK, dedicated to check if the communication has been succesfully executed. Below there i san example, where 2 bytes are transmitted: I2C BUS Signals During Communication As you can see, the first bit to send is the most significative (MSB). For any bit it must be generated a pulse on SCL line. The nineth bit defined ACK normally has a level 0 and it is generated by the device that has received the Data. The level 1 on nineth bit is defined NAK and i t signalizes the last communicated byte, an error, the I2C device absence, etc. 172

Device Addressing on BUS As it happens for all the BUS even for the I2C some different devices can be connected to SCL and SDA lines. In the communications the first byte sent always coincide with the SLAVE ADDRESS, that is the address of the device involved in communication just started. Each I2C device has its own single SLAVE ADDRESS, described in Data Sheet, composed by 7 bits plus the eight bit (LSB) that selects the communication Direction between Read and Write (R/W). Blocks Diagram of I2C BUS Serial EEPROM, AT24C08 173

Many devices have a SLAVE ADDRESS partially modificable, by hardware, with the status of An signals. In this way on the same BUS it can be connected even more devices of the same type as, for example, up to 2 EEPROM 24C08 or 4 components 24C04. The I2C BUS communication can be managed by any microcontroller with at least 2 I/O lines: one Bidirectional and the other can be only monodirectional output. Thanks to specific Instructions of BASCOM, these lines generates the foundamental operations of the communication, that so is managed at high level. Each couple of Mini Module lines can be used as an I2C BUS interface. For convention and compatibility reason among the Pin-Outs of the various Mini Modules, two lines have been selected and standardized as described in the following electric diagrams and inside the Technical Sheets. The diagrams describe the used Mini Module mounted on the test card GMM TST3 and then connected to external experimentation circuits, through the CN3 connector. 174

Example.051. Byte R/W Management of a Serial EEPROM AT24C08 Added Definitions: Added Declarations: Added Instructions: CONFIG SCL ; CONFIG SDA ; I2CINIT ; I2CSTART ; I2CWBYTE ; I2CRBYTE ; I2CSTOP. Added Operators: Example program 51 of BASCOM 8051 course. Test and management program for I2C BUS EEPROM 24C08A, at byte low level, without BASCOM instructions. Electric Application Diagram of Serial EEPROM AT24C08 175

Experimental Card, on Prototype Board, of I2C BUS Serial EEPROM It performs the fundamental operations on the component by using a software I2C BUS interface and by interacting with user on a serial console provided of monitor and keyboard with a fixed physical protocol at 19.200 Baud, 8 Bit x chr, 1 Stop bit, No parity. 176

Connection Between Z2 Socket and CN3 Connector of GMM TST3 This console can be another system capable to support a serial RS 2 3 2 communication. In order to simplify the use it can be used a PC provided of one COMx line, that execute a terminal emulation program as HYPERTERMINAL or the homonym modality provided by BASCOM 8051 (see IDE Configuration). The program works only when the GMM 5115 is mounted on Z2 socket of GMM TST3!! 177

Example.052. R/W Management of a Serial EEPROM 24C08 With Messages Long up to 20 Characters, Displayed on Console Added Definitions: Added Declarations: Added Instructions: Added Operators: Example program 52 of BASCOM 8051 course. Messages read and write on I2C BUS EEPROM 24C08. It performs the operations on the component by using a software I2C BUS interface and by interacting with user on a serial console provided of monitor and keyboard with a fixed physical protocol at 19.200 Baud, 8 Bit x chr, 1 Stop bit, No parity. This console can be another system capable to support a serial RS 2 3 2 communication. In order to simplify the use it can be used a PC provided of one COMx line, that execute a terminal emulation program as HYPERTERMINAL or the homonym modality provided by BASCOM 8051 (see IDE Configuration). The program works only when the GMM 5115 is mounted on Z2 socket of GMM TST3!! 178