AN1713
APPLICATION NOTE
SMBus SLAVE DRIVER FOR ST7 I2C PERIPHERAL
by Microcontroller Division Applications
INTRODUCTION
The goal of this application note is to implement the SMBus slave protocol using ST7 I2C. The
software of this application performs all SMBus bus protocols mentioned in SMBus v1.1. The
device chosen here is ST72F264 which has multi-master I2C capability.
The program described in this application note is in C language. The driver is compatible with
Metrowerks and Cosmic compilers.
1 CHARACTERISTICS
The main characteristics of this SMBus slave driver are:
s
SMBus bus protocols: Quick command, Send/ Receive Byte, Write/ Read Byte, Write/ Read
Word, Write/ Read Block, Process Call Word/ Block
Slave SMBus addressing
CRC-8 Packet Error Checking
s
s
For more details please refer to the SMBus specification v1.1.
2 SMBus
The System Management Bus (SMBus) is a two-wire interface through which various system
component chips can communicate with each other and with the rest of the system. It is based
on the principles of operation of I2C.
2.1 Similarities of SMBus and I2C
s
s
s
s
2 wire bus protocol (1 Clk, 1 Data)
Master-slave communication, Master provides clock
Multi master capability
SMBus data format similar to I2C 7-bit addressing format.
AN1713/0803
1/4
1
SMBus SLAVE DRIVER FOR ST7 I2C PERIPHERAL
Figure 1. Data transfer format
SMBDAT: SMBus data line
SMBCLK: SMBus clock line
2.2 Differences between SMBus and I2C
The following table describes the differences between SMBus and I2C.
Table 1. SMBus vs I2C
SMBus
Max. speed 100 kHz
Min. clock speed 10 kHz
35ms clock low time-out
Logic levels are fixed
Different address types (reserved, dynamic
etc.)
Different bus protocols (quick command, proc-
ess call etc.)
Packet error checking (PEC) implemented
ST7 I2C
Max. speed 400 kHz
No minimum clock speed
No time-out
Logic levels are VDD dependent
7-bit, 10-bit and general call slave address
types
No bus protocols
No packet error checking. Only error status
indication
2.3 SMBus Application
With System Management Bus, a device can provide manufacturer information, tell the
system what its model/part number is, save its state for a suspend event, report different types
of errors, accept control parameters, and return its status. SMBus provides a control bus for
system and power management related tasks.
2/4
2
SMBus SLAVE DRIVER FOR ST7 I2C PERIPHERAL
Section 3
contains the description of the SMBus driver. These functions available with the
driver configure the ST7 I2C peripheral as an SMBus slave and allow it to communicate with
any SMBus master. Here all SMBus v1.1 features are supported. This driver can be used in
the Smart Battery System and other low-power devices.
For more details about the functions please refer to the SMBS_UM.pdf file.
3 SOFTWARE
The Software and user manual are available in the zip file supplied with this application note.
The User manual explains how to use the SMBus slave functions. An example is also pro-
vided to help the user to write an application using SMBus functions.
The following lists the source files which can be used for the SMBus slave interface. They are
separated into 2 types.
1. User accessible files: Following files can be modified by the user depending on the requirement.
main.c: Contains the Example program for SMBus slave driver communication for Write Word, Write
Block and read word protocols. Here the PEC option is not chosen.
SMBS_config.h: Select the CPU frequency and Packet Error Checking option
2. Non-user accessible files: These files should not be modified by the user.
SMBS.c: Contains source code for all the Slave SMBus functions
SMBS.h: Contains prototypes for all the slave SMBus functions
SMBS_hr.c: Contains all the I2C hardware registers
SMBS_hr.h: Declares all the hardware registers as extern
This software is tested only for write word, read word and write block protocols.
3/4
SMBus SLAVE DRIVER FOR ST7 I2C PERIPHERAL
THE PRESENT NOTE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH INFORMATION
REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. AS A RESULT, STMICROELECTRONICS
SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO
ANY CLAIMS ARISING FROM THE CONTENT OF SUCH A NOTE AND/OR THE USE MADE BY CUSTOMERS OF
THE INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
Information furnished is believed to be accurate and reliable. However, STMicroelectronics assumes no responsibility for the consequences
of use of such information nor for any infringement of patents or other rights of third parties which may result from its use. No license is granted
by implication or otherwise under any patent or patent rights of STMicroelectronics. Specifications mentioned in this publication are subject
to change without notice. This publication supersedes and replaces all information previously supplied. STMicroelectronics products are not
authorized for use as critical components in life support devices or systems without the express written approval of STMicroelectronics.
The ST logo is a registered trademark of STMicroelectronics
2003 STMicroelectronics - All Rights Reserved.
Purchase of I C Components by STMicroelectronics conveys a license under the Philips I
2
C Patent. Rights to use these components in an
I
2
C system is granted provided that the system conforms to the I
2
C Standard Specification as defined by Philips.
STMicroelectronics Group of Companies
Australia - Brazil - Canada - China - Finland - France - Germany - Hong Kong - India - Israel - Italy - Japan
Malaysia - Malta - Morocco - Singapore - Spain - Sweden - Switzerland - United Kingdom - U.S.A.
http://www.st.com
2
4/4
©