The EFM32 I2C module allows simple, robust and cost effective communication between integrated circuits using only one data and one clock line.

Similar documents
This application note demonstrates how to use the Direct Memory Access (DMA) module of the EFM32.

Energy Micro University

AN999: WT32i Current Consumption

8-bit MCU Family C8051F93x/92x Errata

AN1095: What to Do When the I2C Master Does Not Support Clock Stretching

EFM8 Universal Bee Family EFM8UB1 Errata

EFM8 Universal Bee Family EFM8UB2 Errata

QSG144: CP2615-EK2 Quick-Start Guide

QSG119: Wizard Gecko WSTK Quick-Start Guide

EFM32TG222 Errata History

SMBus. Target Bootloader Firmware. Master Programmer Firmware. Figure 1. Firmware Update Setup

EFM32 Pearl Gecko Family QSG118: EFM32PG1 SLSTK3401A Quick- Start Guide

EFM32 Happy Gecko Family EFM32HG-SLSTK3400A Quick-Start Guide

Humidity/Temp/Optical EVB UG

UG345: Si72xx Eval Kit User's Guide

Translate HCSL to LVPECL, LVDS or CML levels Reduce Power Consumption Simplify BOM AVL. silabs.com Building a more connected world. Rev. 0.

EFM8 Busy Bee Family EFM8BB2-SLSTK2021A Quick Start Guide

Figure 1. Traditional Biasing and Termination for LVPECL Output Buffers

Date CET Initials Name Justification

UG271: CP2615-EK2 User's Guide

EFM8 Laser Bee Family QSG110: EFM8LB1-SLSTK2030A Quick Start Guide

QSG107: SLWSTK6101A Quick-Start Guide

AN0059.1: UART Flow Control

EFM32LG890 Errata, Chip Rev. E

AN0059.0: UART Flow Control

UG294: CPT213B SLEXP8019A Kit User's Guide

AN976: CP2101/2/3/4/9 to CP2102N Porting Guide

Termination Options for Any-Frequency Si51x XOs, VCXOs

QSG123: CP2102N Evaluation Kit Quick- Start Guide

QSG114: CPT007B SLEX8007A Kit Quick- Start Guide

EFR32 Mighty Gecko Family EFR32MG1 with Integrated Serial Flash Errata History

USB Debug Adapter. Power USB DEBUG ADAPTER. Silicon Laboratories. Stop. Run. Figure 1. Hardware Setup using a USB Debug Adapter

Software Release Note

Figure 1. CP2108 USB-to-Quad UART Bridge Controller Evaluation Board

CP2110-EK CP2110 EVALUATION KIT USER S GUIDE. 1. Kit Contents. 2. Relevant Documentation. 3. Software Setup

AN125 INTEGRATING RAISONANCE 8051 TOOLS INTO THE S ILICON LABS IDE. 4. Configure the Tool Chain Integration Dialog. 1. Introduction. 2.

AN1143: Using Micrium OS with Silicon Labs Thread

AN0018.0: Supply Voltage Monitoring

EFM8 Busy Bee EFM8BB1 Errata

The Si50122-Ax-EVB is used to evaluate the Si50122-Ax. Table 1 shows the device part number and corresponding evaluation board part number.

CP2104-EK CP2104 EVALUATION KIT USER S GUIDE. 1. Kit Contents. 2. Relevant Documentation. 3. Software Setup USBXpress Driver Development Kit

CP2114 Family CP2114 Errata

CP2103-EK CP2103 EVALUATION KIT USER S GUIDE. 1. Kit Contents. 2. Relevant Documentation. 3. Software Setup USBXpress Driver Development Kit

USBXpress Family CP2102N Errata

Router-E and Router-E-PA Wireless Router PRODUCT MANUAL

AN1139: CP2615 I/O Protocol

The process also requires the use of the following files found in the Micriµm Quick Start Package for the FRDM-KL46Z:

µc/probe on the Freescale FRDM-KL05Z without an RTOS

Figure 1. Precision32 AppBuilder

CP2105-EK CP2105 EVALUATION KIT USER S GUIDE. 1. Kit Contents. 2. Relevant Documentation. 3. Software Setup USBXpress Driver Development Kit

EFM32 Zero Gecko EFM32ZG Errata

WT12 EVALUATION KIT DATA SHEET. Monday, 09 September Version 1.7

UG274: Isolated USB Expansion Board User Guide

Wireless Development Suite (WDS) is a software utility used to configure and test the Silicon Labs line of ISM band RFICs.

USB Debug Adapter. Power USB DEBUG ADAPTER. Silicon Laboratories. Stop. Run. Figure 1. Hardware Setup Using a USB Debug Adapter

AN0885: EFM8UB Low Energy USB Overview

Not Recommended for New Designs. Si Data Sheet Errata for Product Revision B

AN0018.1: Supply Voltage Monitoring

8-Bit MCU C8051F85x/86x Errata

USB Debug Adapter. Power USB DEBUG ADAPTER. Silicon Laboratories. Stop. Run. Figure 1. Hardware Setup Using a USB Debug Adapter

AN888: EZR32 Quick Start Guide

UG322: Isolated CAN Expansion Board User Guide

Date CET Initials Name Justification

AN690. Si4010 DEVELOPMENT KIT QUICK-START GUIDE. 1. Purpose. 2. Kit Content. Table 1. Kit Content

2. Key Points. F93x F92x F91x F90x. Figure 1. C8051F93x-C8051F90x MCU Family Memory Size Options

BRD4300B Reference Manual MGM111 Mighty Gecko Module

UG254: CP2102N-MINIEK Kit User's Guide

EFM32 Pearl Gecko Family EFM32PG1 Errata

AN1160: Project Collaboration with Simplicity Studio

TS9004 Demo Board FEATURES ORDERING INFORMATION

EFR32MG13, EFR32BG13 & EFR32FG13 Revision C and Data Sheet Revision 1.0

C8051F411-EK C8051F411 EVALUATION KIT USER S GUIDE. 1. Kit Contents. 2. Kit Overview. 3. Evaluation Board Interface LCD User Interface

USB Debug Adapter. Power USB DEBUG ADAPTER. Silicon Laboratories. Stop. Run. Figure 1. Hardware Setup Using a USB Debug Adapter

USB Debug Adapter. Power USB DEBUG ADAPTER. Silicon Laboratories. Stop. Run. Figure 1. Hardware Setup Using a USB Debug Adapter

AN1106: Optimizing Jitter in 10G/40G Data Center Applications

Date CET Initials Name Justification

AN116. Power Management Techniques and Calculation. Introduction. Key Points. Power Saving Methods. Reducing System Clock Frequency

Si7005USB-DONGLE. EVALUATION DONGLE KIT FOR THE Si7005 TEMPERATURE AND HUMIDITY SENSOR. 1. Introduction. 2. Evaluation Kit Description

UG369: Wireless Xpress BGX13P SLEXP8027A Kit User's Guide

UG232: Si88xxxISO-EVB User's Guide

USB Debug Adapter. Power USB DEBUG ADAPTER. Silicon Laboratories. Stop. Run. Figure 1. Hardware Setup using a USB Debug Adapter

AN1117: Migrating the Zigbee HA Profile to Zigbee 3.0

Table 1. Kits Content. Qty Part Number Description. Si4010 Simplified Key Fob Demo Kit 868 MHz

FBOUT DDR0T_SDRAM0 DDR0C_SDRAM1 DDR1T_SDRAM2 DDR1C_SDRAM3 DDR2T_SDRAM4 DDR2C_SDRAM5 DDR3T_SDRAM6 DDR3C_SDRAM7 DDR4T_SDRAM8 DDR4C_SDRAM9 DDR5T_SDRAM10

QSG159: EFM32TG11-SLSTK3301A Quick- Start Guide

AN0015.0: EFM32 and EZR32 Wireless

AN926: Reading and Writing Registers with SPI and I 2 C

UG313: Thunderboard Sense 2 Bluetooth Low Energy Demo User's Guide

QSG155: Using the Silicon Labs Dynamic Multiprotocol Demonstration Applications

Selector Switch SDA. Pin 1. SCL Pin 2. I2C Bus. Pin 7. Pin 8. Pin 1. Pin 2. Pin 7 Pin 8. Pin 1 Pin 2. Pin 7 Pin 8

Software Design Specification

C8051F36x-DK. C8051F36x DEVELOPMENT KIT USER S GUIDE. 1. Relevant Devices. 2. Kit Contents. 3. Hardware Setup Using a USB Debug Adapter

QSG153: Micrium s μc/probe Tool Quick- Start Guide

ADC Evaluation Platform GUI User s Guide

UDP UPPI Card UG UDP UPPI CARD USER S GUIDE. 1. Introduction. Figure 1. UPPI Cards with and without Radio

Figure 1. Proper Method of Holding the ToolStick. Figure 2. Improper Method of Holding the ToolStick

ETRX3DVK Development Kit Quick-Start Guide

UG352: Si5391A-A Evaluation Board User's Guide

QSG107: SLWSTK6101A/B Quick-Start Guide

AN888: EZR32 Simple TRX Application Quick Start Guide

Transcription:

...the world's most energy friendly microcontrollers I2C Multimaster AN0011 - Application Note Introduction The EFM32 I2C module allows simple, robust and cost effective communication between integrated circuits using only one data and one clock line. This application note demonstrates how to use the EFM32 I2C module in multimaster mode. Two EFM32s are connected; each EFM32 will operate in both slave and master mode. This application note includes: This PDF document Source files (zip) Example C-code Multiple IDE projects

1 I2C Theory...the world's most energy friendly microcontrollers 1.1 General The I2C allows connection of up to 128 individually addressable devices using only two bi-directional lines; clock (SCL) and data (SDA). The only additional hardware required is a pull-up resistor for each of the lines. The I2C protocol and the EFM32 I2C module features several mechanisms for handling bus conflicts and contention. A possible I2C connection scheme is illustrated in Figure 1.1 (p. 2). Figure 1.1. I2C Power supply V DD I 2 C m aster # 1 I 2 C m aster # 2 I 2 C slave # 1 I 2 C slave # 2 I 2 C slave # 3 R p SDA SCL 1.2 I2C Signals/Frames START and STOP conditions are used to initiate and stop transactions on the I2C-bus. All transactions on the bus begin with a START condition (S) and end with a STOP condition (P). As illustrated in Figure 1.2 (p. 2), a START condition is generated by pulling the SDA line low while SCL is high, and a STOP condition is generated by pulling the SDA line high while SCL is high. Also illustrated in Figure 1.2 (p. 2) is I2C bit transfer. Note that data must be stable for the whole duration of the SCL high period. Figure 1.2. Start, Stop and Data I2C Start and Stop I2C Bit transfer SDA SDA SCL SCL S START condition P STOP condition Data change allowed Data stable Data change allowed A master initiates a transfer by sending a START followed by the address of the slave it wishes to contact and a single R/W bit telling whether it wishes to read from (R/W = 1) or write to the slave (R/W = 0). After the 7-bit address and the R/W bit, the master releases the bus, allowing the slave to acknowledge the request. During the next bit-period, the slave pulls SDA low (ACK) if it acknowledges the request, or keeps it high if it does not acknowledge it (NACK). Following the address acknowledge, either the slave or master transmits data, depending on the value of the R/W bit. After every 8-bit byte transmitted on the SDA line, the transmitter releases the line to allow the receiver to transmit an ACK or a NACK. Both the data and the address are transmitted with the most significant bit first. The master ends the transmission after a (N)ACK by sending a STOP condition on the bus. After a STOP condition, any master can initiate a new transfer. 2010-11-16 - an0011_rev1.01 2 www.energymicro.com

...the world's most energy friendly microcontrollers An example of a master writing to a slave is shown in Figure 1.3 (p. 3). The identifiers used are: S - Start bit, ADDR - Address, W - Write(0), A - ACK, N - NACK, DATA - Data, P - Stop bit. Figure 1.3. Master Write to Slave S ADDR W A DATA A P For further details about I2C and the EFM32 I2C module, please see the EFM32 reference guide. 2010-11-16 - an0011_rev1.01 3 www.energymicro.com

2 Software Example...the world's most energy friendly microcontrollers 2.1 General This application note makes the EFM32 operate in a multi-master configuration. Two EFM32 I2C modules are connected and set up to both transmit (master mode) and receive data (slave mode) using a common I2C bus. 2.2 Program Flow Each EFM32 has enabled I2C address match interrupt and Real Time Counter (RTC) interrupt. Both these interrupts are capable of waking up the EFM32 from Deep Sleep mode (EM2), hence the idle state current consumption is extremely low. The I2C is continuously monitoring the I2C line. If a start condition followed by the I2Cs defined address, an address match interrupt is issued and data is received until a stop condition is detected. The Real Time Counter (RTC) is set to wake up the EFM32 regularly. If a reception is not in progress at the time of wake-up, a master transmission is initiated. The address match interrupt is disabled during the transmission and re-enabled afterwards. The operation is illustrated in the state diagram shown in Figure 2.1 (p. 4) Figure 2.1. Program state machine Enter EM2 ADDR- Match? Yes Slave Mode Receive data No RTC Tim eout? Yes Master Mode Transm it data No During transmission, the PC0 pin is set in order to determine transfer direction for example by using a logic analyzer. On the starter kit, this pin is connected to LED0, which is lit during transmission. Please refer to the source code for further details. 2.3 Connections The software example uses location 1 for the SCL (PD7) and SDA (PD6) pins. Connect the PD6 pins and the PD7 pins of the EFM32s, respectively. The configuration is illustrated in Figure 2.2 (p. 5) 2010-11-16 - an0011_rev1.01 4 www.energymicro.com

...the world's most energy friendly microcontrollers Figure 2.2. Connection EFM32 EFM32 PD6 PD7 SDA SCL PD6 PD7 In the GPIO module of the EFM32 the pull-up resistors have been enabled, hence external pull-up resistors are not necessary to make the example work. However, external resistors are generally preferable as they keep the lines defined at all times. For example, when the EFM32 is in reset-state, the pull-up configuration in the GPIO module is not available, which leaves the I2C bus undefined. 2010-11-16 - an0011_rev1.01 5 www.energymicro.com

3 Revision History...the world's most energy friendly microcontrollers 3.1 Revision 1.01 November 16th, 2010. Removed clearing of RXDATAV interrupt flag through I2C_IFC since this operation is ignored. Changed example folder structure, removed build and src folders. Added chip-init function. 3.2 Revision 1.00 September 20th, 2010. Initial revision. 2010-11-16 - an0011_rev1.01 6 www.energymicro.com

A Disclaimer and Trademarks A.1 Disclaimer...the world's most energy friendly microcontrollers Energy Micro AS intends to provide customers with the latest, accurate, and in-depth documentation of all peripherals and modules available for system and software implementers using or intending to use the Energy Micro products. Characterization data, available modules and peripherals, memory sizes and memory addresses refer to each specific device, and "Typical" parameters provided can and do vary in different applications. Application examples described herein are for illustrative purposes only. Energy Micro reserves the right to make changes without further notice and limitation to product information, specifications, and descriptions herein, and does not give warranties as to the accuracy or completeness of the included information. Energy Micro shall have no liability for the consequences of use of the information supplied herein. This document does not imply or express copyright licenses granted hereunder to design or fabricate any integrated circuits. The products must not be used within any Life Support System without the specific written consent of Energy Micro. A "Life Support System" is any product or system intended to support or sustain life and/or health, which, if it fails, can be reasonably expected to result in significant personal injury or death. Energy Micro products are generally not intended for military applications. Energy Micro products shall under no circumstances be used in weapons of mass destruction including (but not limited to) nuclear, biological or chemical weapons, or missiles capable of delivering such weapons. A.2 Trademark Information Energy Micro, EFM32, EFR, logo and combinations thereof, and others are the registered trademarks or trademarks of Energy Micro AS. ARM, CORTEX, THUMB are the registered trademarks of ARM Limited. Other terms and product names may be trademarks of others. 2010-11-16 - an0011_rev1.01 7 www.energymicro.com

B Contact Information...the world's most energy friendly microcontrollers B.1 Energy Micro Corporate Headquarters Postal Address Visitor Address Technical Support Energy Micro AS P.O. Box 4633 Nydalen N-0405 Oslo NORWAY www.energymicro.com Phone: +47 23 00 98 00 Fax: + 47 23 00 98 01 B.2 Global Contacts Energy Micro AS Sandakerveien 118 N-0405 Oslo NORWAY support.energymicro.com Phone: +47 40 10 03 01 Visit www.energymicro.com for information on global distributors and representatives or contact sales@energymicro.com for additional information. Americas Europe, Middle East and Africa Asia and Pacific www.energymicro.com/americas www.energymicro.com/emea www.energymicro.com/asia 2010-11-16 - an0011_rev1.01 8 www.energymicro.com

...the world's most energy friendly microcontrollers Table of Contents 1. I2C Theory... 2 1.1. General... 2 1.2. I2C Signals/Frames... 2 2. Software Example... 4 2.1. General... 4 2.2. Program Flow... 4 2.3. Connections... 4 3. Revision History... 6 3.1. Revision 1.01... 6 3.2. Revision 1.00... 6 A. Disclaimer and Trademarks... 7 A.1. Disclaimer... 7 A.2. Trademark Information... 7 B. Contact Information... 8 B.1. Energy Micro Corporate Headquarters... 8 B.2. Global Contacts... 8 2010-11-16 - an0011_rev1.01 9 www.energymicro.com

...the world's most energy friendly microcontrollers List of Figures 1.1. I2C Power supply... 2 1.2. Start, Stop and Data... 2 1.3. Master Write to Slave... 3 2.1. Program state machine... 4 2.2. Connection... 5 2010-11-16 - an0011_rev1.01 10 www.energymicro.com