Initialization/Application Information - ROHS MC9S08QE128 Reference Manual

Table of Contents

Advertisement

12.7

Initialization/Application Information

1.
Write: IICC2
— to enable or disable general call
— to select 10-bit or 7-bit addressing mode
2.
Write: IICA
— to set the slave address
3.
Write: IICC1
— to enable IIC 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
1.
Write: IICF
— to set the IIC baud rate (example provided in this chapter)
2.
Write: IICC1
— to enable IIC 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
5.
Write: IICC1
— to enable TX
6.
Write: IICC1
— to enable MST (master mode)
7.
Write: IICD
— with the address of the target slave. (The LSB of this byte will determine whether the communication is
master receive or transmit.)
The routine shown in
incoming IIC message that contains the proper address will begin IIC communication. For master operation,
communication must be initiated by writing to the IICD register.
IICA
Address to which the module will respond when addressed as a slave (in slave mode)
IICF
Baud rate = BUSCLK / (2 x MULT x (SCL DIVIDER))
IICEN
IICC1
Module configuration
TCF
IICS
Module status flags
IICD
Data register; Write to transmit IIC data read to read IIC data
IICC2 GCAEN ADEXT
Address configuration
Freescale Semiconductor
Module Initialization (Slave)
Module Initialization (Master)
Module Use
Figure 11-3
can handle both master and slave IIC operations. For slave operation, an
Register Model
MULT
IICIE
MST
IAAS
BUSY
ARBL
0
Figure 12-11. IIC Module Quick Start
MC9S08QE128 MCU Series Reference Manual, Rev. 2
Figure 11-3
Figure 11-3
AD[7:1]
ICR
TX
TXAK
RSTA
0
SRW
DATA
0
0
AD10
Inter-Integrated Circuit (S08IICV2)
0
0
0
IICIF
RXAK
AD9
AD8
235

Hide quick links:

Advertisement

Table of Contents
loading

Related Products for ROHS MC9S08QE128

This manual is also suitable for:

Mc9s08qe96Mc9s08qe64

Table of Contents