| The Datasheet Archive - 100 Million Datasheets from 7500 Manufacturers. |
Application Note 1999-03-15 Interfacing 24Cxx, Application Note R
Top Searches for this datasheetInterfacing 24Cxx I2C-Bus Serial EEPROMs 8051 Controller Family, especially Siemens C500 Controller Family Application Note 1999-03-15 Interfacing 24Cxx, Application Note Revision History: Current Version: 1999-03-15 Previous Version: Page Page previous current Version) Version) Subjects (major changes since last revision) Page Protection Modeis trademark Siemens Edition 1999-03-15 Published Siemens Bereich Halbleiter, MarketingKommunikation, 81541 Siemens 1999. Rights Reserved. Attention please! patents other rights third parties concerned, liability only assumed components, applications, processes circuits implemented within components assemblies. information describes type component shall considered assured characteristics. Terms delivery rights change design reserved. questions technology, delivery prices please contact Semiconductor Group Offices Germany Siemens Companies Representatives worldwide (see address list). technical requirements components contain dangerous substances. information types question please contact your nearest Siemens Office, Semiconductor Group. Siemens approved CECC manufacturer. Packing Please recycling operators known you. also help touch with your nearest sales office. agreement will take packing material back, sorted. must bear costs transport. packing material that returned unsorted which obliged accept, shall have invoice costs incurred. Components used life-support devices systems must expressly authorized such purpose! Critical components1 Semiconductor Group Siemens only used life-support devices systems2 with express written approval Semiconductor Group Siemens critical component component used life-support device system whose failure reasonably expected cause failure that life-support device system, affect safety effectiveness that device system. Life support devices systems intended implanted human body, support and/or maintain sustain human life. they fail, reasonable assume that health user endangered. Interfacing 24Cxx I2C-bus Serial EEPROMS 8051 microcontroller, especially Siemens C5xx Table Contents Page Introduction I2C-bus Data Transfer formats Timing Diagram Hardware Connection Software Description Software Concept Description Software Routines Software Compilation Semiconductor Group 1999-03-15 Interfacing 24Cxx I2C-bus Serial EEPROMS 8051 microcontroller, especially Siemens C5xx Introduction applications field consumer electronics, telecommunications, automotive industrial electronics need non-volatile memory. Because their byte level flexibility, requirements, power consumption, small footprint cost, Siemens serial EEPROMs popular choice non-volatile storage. This application note provides assistance source code ease design process interfacing 24Cxx I2C-bus serial EEPROM 8051 controller family, especially Siemens C500 8-bit controller family. source code (24Cxx8b.EXE) well datasheets 24Cxx EEPROMs also available Siemens World Wide site address: I2C-Bus 24Cxx serial EEPROMs industry standard I2C-bus protocol data transfer. I2C-bus Inter-Integrated Circuit been developed Philips. allows integrated circuits communicate directly with each other simple bi-directional 2wirebus. lines serial clock line (SCL), serial data line (SDA). Nowadays, I2C-bus becomes standard system which used consumer electronics, telecommunications industrial electronics. This software interfacing 24Cxx I2C-bus serial EEPROM 8051 controller family I2C-bus emulation supports single master protocol only. using time generate clock, transmit receive data. clock frequency I2C-bus achieve kHz. Data Transfer Formats I2C-bus protocol allows several devices share same bus. this software microcontroller serves master, initiating terminating data transfers, generating clock which regulates flow data, transmitting receiving data. EEPROMs only serve slaves, receiving transmitting data. General information about data transfer formats devices I2C-bus will given now, more detailed information regarding 24Cxx please refer datasheets. master initiates data transfer generating start condition (SDA going while high). master terminates data transfer generating stop condition (SDA going high while high). Every data line must bits long. number data bytes transferred between START STOP condition limited I2C-bus protocol. data line must stable during HIGH period clock. Data only change during phase clock. data byte transferred serially with most significant first, followed acknowledge every clock pulse (see figure Semiconductor Group 1999-03-15 Interfacing 24Cxx I2C-bus Serial EEPROMS 8051 microcontroller, especially Siemens C5xx START Condition Data allowed Change Acknowledge STOP Condition IED02128 Figure Data Transfer Conventions receiver obliged generate acknowledge after each byte data that been received. master receiving data, must signal data transfer slave generating acknowledge last byte data received (see figure Then, slave must release data line allow master generate STOP condition. Figure shows I2C-bus data transfer format writing data from master slave device. command byte data direction (R/W). data direction indicates transmission (WRITE). indicates request data (READ). Figure shows data transfer format reading data from slave device. Command Byte Data Byte IED02132 Activity Master Line Activity EEPROM Figure Read Sequence Semiconductor Group 1999-03-15 Interfacing 24Cxx I2C-bus Serial EEPROMS 8051 microcontroller, especially Siemens C5xx Activity Master Line Activity EEPROM Command Byte EEPROM Address Data Byte IED02129 Figure Write Sequence Timing Diagram clock frequency range kHz. Occasionally, slave devices slow down transmission holding clock line after receiving byte data from microcontroller. This event defined WAIT condition. Therefore, master needs switch output high impedance read line before transmitting another byte data slave device. Figure shows data transfer timing requirements detail. description used abbreviations shown table minimum timing requirements needed fulfilled order I2C-bus operate properly. HIGH SU.STA HD.STA SU.DAT HD.DAT SU.STO Start Condition Stop Condition IED02127 Figure Timing Semiconductor Group 1999-03-15 Interfacing 24Cxx I2C-bus Serial EEPROMS 8051 microcontroller, especially Siemens C5xx Table Parameter Symbol Standard Mode I2C-bus min. clock frequency max. 1000 Fast Mode I2C-bus min. max. Units fSCL tlow Clock pulse width Clock pulse width high thigh rise time fall time Start set-up time tSU.STA Start hold time tHD.STA tSU.DAT Data set-up time tHD.DAT Data hold time data valid Stop set-up time tSU.STO Time must free tBUF Data hold time before transmission start Capacitive load each line Semiconductor Group 1999-03-15 Interfacing 24Cxx I2C-bus Serial EEPROMS 8051 microcontroller, especially Siemens C5xx Hardware Connection. Every device connected I2C-bus must have open drain/open collector output both clock (SCL) data (SDA) lines. Each lines connected supply common pull-up resistor. connection among master many slave devices shown figure number devices that connected I2Cbus limited only maximum load capacitance Theoretically serial EEPROMs connected same I2C-bus. types 24Cxx family support this feature, please refer datasheets. Slave Master Slave Slave Slave Slave Slave Slave Slave IES02183 Figure Configuration Semiconductor Group 1999-03-15 Interfacing 24Cxx I2C-bus Serial EEPROMS 8051 microcontroller, especially Siemens C5xx Table Software Description Software Concept Device Type 24C01 24C02 24C04 24C08 24C16 24C164 24C01/P 24C02/P 24C04/P 24C08/P 24C16/P 24C164/P 24C32 24C64 24C32/P 24C64/P Directory 2401_8B I2C-Bus module I2C_SW8B.C I2C_SW8B.H I2C_8B.DEF EEPROM module 24SW01.C 24SW01.H Demo program 24dem01.C 2401_8BP I2C_SW8B.C I2C_SW8B.H I2C_8B.DEF I2C_SW8B.C I2C_SW8B.H I2C_8B.DEF I2C_SW8B.C I2C_SW8B.H I2C_8B.DEF I2C_SW8B.C I2C_SW8B.H I2C_8B.DEF 24SW01P.C 24SW01P.H 24SW01P.C 24SW01P.H 24dem01P.C 2404_8BP 24dem04P.C 2432_8B 24SW32.C 24SW32.H 24SW32P.C 24SW32P.H 24dem32.C 2432_8BP 24dem32P.C software each device type (e.g. 24C01) consists basic I2C-bus module, control module with EEPROM routines demo program. I2C-bus module contains subroutines I2C-bus protocol. EEPROM module uses these subroutines implement command sequences 24Cxx devices. demo program shows modules used application program. Table gives overview which modules demo program have used different device types which directory 24Cxx8b.EXE these files found. first module (I2C_SW8B.C) clock data I2C-bus generated using time 8051 microcontroller. clock frequency I2C-bus approximately with one-cycle instruction. time delay realized with commands. clock less more than one-cycle instruction takes more less than this software module modified achieve frequency. Semiconductor Group 1999-03-15 Interfacing 24Cxx I2C-bus Serial EEPROMS 8051 microcontroller, especially Siemens C5xx software modification involves reducing eliminating time delay. addition, check WAIT condition before every byte sent received rather than checking WAIT condition before every sent received. aware fact that this software module interrupted others software modules that involved hardware interrupts. other words, this software module equivalent those software modules with lowest priority interrupt level. advantage using time generate clock data that only port pins other hardware peripheral 8051 microcontroller used. Therefore, those hardware peripherals reserved other time critical software application. I2C_SW8B.C software module divided into software subroutines which accessed external programs. These software basic subroutines used construct data transfer format I2C-bus: I2cInit, I2cStart, I2cMasterWrite, I2cMasterRead I2cStop. second module (24SWxx.C)shows whole functionality 24Cxx I2C-bus serial EEPROMs using basic subroutines first module (I2C_SW8B.C). 24SWxx.C software modules divided into software subroutines which accessed external programs: ByteWriteE2prom, PageWriteE2prom, Ack_pol_r, Ack_pol_w, RandomReadE2prom, CurrentReadE2prom SequentialReadE2prom. routines Ack_pol_r Ack_pol_w contain time critical wait cycles that calculated one-cycle instruction. clock less more than one-cycle instruction takes more less than 300ns, these routines might modified. devices with Page Protection Mode(SLx 24Cxx./P) software modules 24SWxxP.C contain additionally basic subroutines routines especially Page Protection ModeTM: PPMWriteE2prom, PPMEraseE2prom PPMReadE2prom. third part this software package contains demo programs devices without (24demxx.C) with Page Protection Mode(24demxxP.C). These demo programs demonstrate software modules 24SWxx.C/24SWxxP.C used application program. Semiconductor Group 1999-03-15 Interfacing 24Cxx I2C-bus Serial EEPROMS 8051 microcontroller, especially Siemens C5xx Description Software Routines I2C-BUS Software Module Source file: I2C_SW8B.C Header file: I2C_SW8B.H User definition file: I2C_8B.DEF Description I2C-bus module simulates standard I2C-bus single master protocol using time 8051 microcontroller. clock well transmit/receive data handled time delay. port pins microcontroller which used clock transmit/receive data defined I2C_8B.DEF. Module Subroutines void CheckClock(); unsigned char Check_SCL(); 3.unsigned char I2cInit(); 4.void I2cStart(); 5.unsigned char I2cMasterWrite(unsigned char input_byte); 6.unsigned char I2cMasterRead(unsigned char ack); 7.unsigned char I2cStop(); void CheckClock() Send HIGH read line. will wait until line been released from slave device (SLx 24Cxx) every data sent received. Parameter None Description Semiconductor Group 1999-03-15 Interfacing 24Cxx I2C-bus Serial EEPROMS 8051 microcontroller, especially Siemens C5xx unsigned char Check_SCL() Send HIGH read line. will wait until line been released from slave device (SLx 24Cxx) with time-out approximately Parameter None Return return value clock data lines have problem. Otherwise, return value will "1". Description unsigned char I2cInit() Check clock data lines faulty like pull-up resistor SDA/SCL pulldown slave device. Parameter None Return return value clock data lines have problem. Otherwise, return value will "1". Description void I2cStart() Generate START condition I2C-bus. Parameter None Description Semiconductor Group 1999-03-15 Interfacing 24Cxx I2C-bus Serial EEPROMS 8051 microcontroller, especially Siemens C5xx unsigned char I2cMasterWrite(unsigned char input_byte) Output byte data slave device. Check WAIT condition before every sent. Parameter unsigned char input_byte Return return value "0", write sequence received from slave device (SLx 24Cxx) sucessfully. Otherwise, write sequence needed sent again because there acknowledge from slave device. Description byte data sent slave device. unsigned char I2cMasterRead(unsigned char ack) Read byte data from slave device. Check WAIT condition before every received. Parameter unsigned char Description generate output master after byte data received. generate HIGH output master after byte data received. Return return value "0", reading byte data from slave device (SLx 24Cxx) successfully. Otherwise, byte data needed received again, because there acknowledge from slave device. Semiconductor Group 1999-03-15 Interfacing 24Cxx I2C-bus Serial EEPROMS 8051 microcontroller, especially Siemens C5xx unsigned char I2cStop() Generate STOP condition I2C-bus. addition, will generate clock pulses until line released slave device (SLx 24Cxx) time-out approximately before returning "HIGH" value indicating error. Parameter None Return return value clock data lines have problem. Otherwise, return value will "1". Description I2C-Bus EEPROM Software Source file: 24SW01P.C Header file: 24SW01P.H Description EEPROM module 24SW01P.C shows whole functionality 24Cxx EEPROMs contains additionally subroutines Page Protection Modeusing I2C-bus module (I2C_SW8B.C). Table gives short overview about main differences between module 24SW01P.C other EEPROM modules. Table EEPROM modules 24SW01.C 24SW032.C Main differences module 24SW01P.C only subroutines included only subroutines included, instead address byte (unsigned char address) addressing, address bytes used (unsigned char addresshi, unsigned addresslo) instead address byte (unsigned char address) addressing, address bytes used (unsigned char addresshi, unsigned addresslo) 24SW32P.C Semiconductor Group 1999-03-15 Interfacing 24Cxx I2C-bus Serial EEPROMS 8051 microcontroller, especially Siemens C5xx Software routines unsigned char ByteWriteE2prom(unsigned char command, unsigned char address,unsigned char *buffer); unsigned char PageWriteE2prom (unsigned char command, unsigned char address, unsigned char *buffer, unsigned char count); unsigned char Ack_pol_r(unsigned char command); unsigned char Ack_pol_w(unsigned char command); unsigned char RandomReadE2prom (unsigned char command, unsigned char address, unsigned char *buffer); unsigned char CurrentReadE2prom (unsigned char command, unsigned char *buffer); unsigned char SequentialReadE2prom(unsigned char command, unsigned char address, unsigned char *buffer, unsigned char count); These routines only 24Cxx/P with Page Protection Mode: unsigned char PPMWriteE2prom(unsigned char command, unsigned char address, unsigned char *buffer, unsigned char count); unsigned char PPMEraseE2prom(unsigned char command, unsigned char address, unsigned char *buffer, unsigned char count); 10.unsigned char PPMReadE2prom(unsigned char command, unsigned char address, unsigned char *buffer, unsigned char count); Semiconductor Group 1999-03-15 Interfacing 24Cxx I2C-bus Serial EEPROMS 8051 microcontroller, especially Siemens C5xx unsigned char ByteWriteE2prom(unsigned char command, unsigned char address, unsigned char *buffer) Write data byte E2PROM. flow this subroutine derived from data format writing shown figure Parameter None Return return value "0", programming E2PROM started. Otherwise, data needed sent again because there acknowledge from slave device. Description unsigned char PageWriteE2prom(unsigned char command, unsigned char address,unsigned char *buffer,unsigned char count) Write number data bytes E2PROM. Parameter unsigned char command unsigned char address unsigned char *buffer unsigned char count Return return value "0", programming E2PROM started. Otherwise, data needed sent again because there acknowledge from slave device. Description specifies command byte specifies EEPROM address point location data sent number bytes sent Semiconductor Group 1999-03-15 Interfacing 24Cxx I2C-bus Serial EEPROMS 8051 microcontroller, especially Siemens C5xx unsigned char Ack_pol_r(unsigned char command) Check completion programming sending read commands. programming completed, acknowledge will "0". Parameter unsigned char command Return return value "0", programming E2PROM considered done. Otherwise, programming last much more than (CPU clock one-cycle instruction) error occurred. Description specifies command byte unsigned char Ack_pol_w(unsigned char command); Check completion programming sending write commands. programming completed, acknowledge will "0". Parameter unsigned char command Return return value "0", programming E2PROM considered done. Otherwise, programming last much more than (CPU clock one-cycle instruction) error occurred. Description specifies command byte Semiconductor Group 1999-03-15 Interfacing 24Cxx I2C-bus Serial EEPROMS 8051 microcontroller, especially Siemens C5xx unsigned char RandomReadE2prom(unsigned char command, unsigned char address,unsigned char *buffer) Read data byte from E2PROM. Parameter unsigned char command unsigned char address unsigned char *buffer Return return value "0", reading E2PROM completed. Otherwise, data needed sent again, because there acknowledge from slave device. Description specifies command byte specifies EEPROM address point location data stored unsigned char CurrentReadE2prom (unsigned char command, unsigned char *buffer) Read data byte from current E2PROM address. flow this subroutine derived from data format reading from E2PROM Figure Parameter unsigned char command unsigned char *buffer Return return value "0", reading E2PROM completed. Otherwise, data needed sent again, because there acknowledge from slave device. Description specifies command byte point location data stored Semiconductor Group 1999-03-15 Interfacing 24Cxx I2C-bus Serial EEPROMS 8051 microcontroller, especially Siemens C5xx unsigned char SequentialReadE2prom (unsigned char command, unsigned char address,unsigned char *buffer, unsigned char count) Read number data bytes from E2PROM. Parameter unsigned char command unsigned char address unsigned char *buffer unsigned char count Return return value "0", reading E2PROM completed. Otherwise, data needed sent again, because there acknowledge from slave device. Description specifies command byte specifies EEPROM address point location data sent number bytes sent unsigned char PPMWriteE2prom(unsigned char command, unsigned char address, unsigned char *buffer, unsigned char count) Protect page. Therefore "0". Parameter unsigned char command unsigned char address unsigned char *buffer unsigned char count Return return value "0", programming started. Otherwise, data needed sent again because there acknowledge from slave device. Description specifies command byte specifies EEPROM address point location data sent byte number page sent Semiconductor Group 1999-03-15 Interfacing 24Cxx I2C-bus Serial EEPROMS 8051 microcontroller, especially Siemens C5xx unsigned char PPMEraseE2prom(unsigned char command, unsigned char address,unsigned char *buffer,unsigned char count) Unprotects page. Therefore "1". Parameter unsigned char command unsigned char address unsigned char *buffer unsigned char count Return return value "0", programming started. Otherwise, data needed sent again because there acknowledge from slave device. Description specifies command byte specifies EEPROM address point location data sent byte number page sent unsigned char PPMReadE2prom(unsigned char command, unsigned char address,unsigned char *buffer, unsigned char count) Read status bits from E2PROM. Parameter unsigned char command unsigned char address unsigned char *buffer unsigned char count Return return value "0", reading E2PROM completed. Otherwise, data needed sent again because there acknowledge from slave device. Description specifies command byte specifies EEPROM address point location data stored number bits read Semiconductor Group 1999-03-15 Interfacing 24Cxx I2C-bus Serial EEPROMS 8051 microcontroller, especially Siemens C5xx I2C-BUS EEPROM Demonstration Program Description demo program shows 24SWxx.C/24SWxxP.C software modules used application program. verify whether routines demo program runs successfully, table show memory content before/after running demo program. Table address Initial memory content 24dem01.C 24dem32.C Memory content after running demo program Table address 24dem01P.C 24dem04P.C 24dem32P.C Initial memory content Memory content after running demo program 12)FF protection "1", page unprotected; protection "0", page protected Only specified "1"( e.g. e.g. Semiconductor Group 1999-03-15 Interfacing 24Cxx I2C-bus Serial EEPROMS 8051 microcontroller, especially Siemens C5xx Software Compilation compilation this software using KEIL C8051 compiler. First all, open µVision/51 from Keil. Under PROJECT menu click "New Project" enter project name. Then I2C-bus module, EEPROM module demo program project according table (e.g. I2C_SW8B.C, 24sw01P.C 24dem01P.C)and save project. complete compilation also header definition files necessary (e.g. I2C_SW8.H, 24sw01P.H,I2C_8B.DEF) project ready compile link object files. compiling linking project done clicking icon "BUILD ALL". 24Cxx8b.EXE compressed file containing directories. Each directory contains header, definition files which needed demo program special device type (see table Semiconductor Group 1999-03-15 Other recent searchesTMS320C6416 - TMS320C6416 TMS320C6416 Datasheet TMPM341FDXBG - TMPM341FDXBG TMPM341FDXBG Datasheet TMPM341FYXBG - TMPM341FYXBG TMPM341FYXBG Datasheet SPWS031D - SPWS031D SPWS031D Datasheet SBM1040 - SBM1040 SBM1040 Datasheet CM7560 - CM7560 CM7560 Datasheet A29L800 - A29L800 A29L800 Datasheet
Privacy Policy | Disclaimer |