Initialization/Application Information - NXP Semiconductors MKL27Z128VFM4 Reference Manual

Table of Contents

Advertisement

36.6 Initialization/application information

Module Initialization (Slave)
1. Write: Control Register 2
• to enable or disable general call
• to select 10-bit or 7-bit addressing mode
2. Write: Address Register 1 to set the slave address
3. Write: Control Register 1 to enable the I2C module and interrupts
4. Initialize RAM variables (IICEN = 1 and IICIE = 1) for transmit data
5. Initialize RAM variables used to achieve the routine shown in the following figure
Module Initialization (Master)
1. Write: Frequency Divider register to set the I2C baud rate (see example in
description of ICR)
2. Write: Control Register 1 to enable the I2C module and interrupts
3. Initialize RAM variables (IICEN = 1 and IICIE = 1) for transmit data
4. Initialize RAM variables used to achieve the routine shown in the following figure
5. Write: Control Register 1 to enable TX
6. Write: Control Register 1 to enable MST (master mode)
7. Write: Data register with the address of the target slave (the LSB of this byte
determines whether the communication is master receive or transmit)
The routine shown in the following figure encompasses both master and slave I2C
operations. For slave operation, an incoming I2C message that contains the proper
address begins I2C communication. For master operation, communication must be
initiated by writing the Data register. An example of an I2C driver which implements
many of the steps described here is available in
Circuit on ColdFire+ and Kinetis
Freescale Semiconductor, Inc.
.
KL27 Sub-Family Reference Manual , Rev. 5, 01/2016
Chapter 36 Inter-Integrated Circuit (I2C)
AN4342: Using the Inter-Integrated
643

Advertisement

Table of Contents
loading

Table of Contents