Inter-Integrated Circuit (S08IICV2)
MC9S08QE128 MCU Series Reference Manual, Rev. 2
Freescale Semiconductor
235
12.7
Initialization/Application Information
Figure 12-11. IIC Module Quick Start
Module Initialization (Slave)
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
Figure 11-3
Module Initialization (Master)
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
Figure 11-3
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.)
Module Use
The routine shown in
Figure 11-3
can handle both master and slave IIC operations. For slave operation, an
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.
0
IICF
IICA
Baud rate = BUSCLK / (2 x MULT x (SCL DIVIDER))
TX
TXAK
RSTA
0
0
IICC1
IICEN
IICIE
MST
Module configuration
ARBL
0
SRW
IICIF
RXAK
IICS
TCF
IAAS
BUSY
Module status flags
Register Model
AD[7:1]
Address to which the module will respond when addressed as a slave (in slave mode)
MULT
ICR
IICD
DATA
Data register; Write to transmit IIC data read to read IIC data
0
AD10
AD9
AD8
IICC2 GCAEN
ADEXT
Address configuration
0
0
Содержание MC9S08QE128
Страница 2: ......
Страница 4: ......
Страница 49: ...Chapter 3 Modes of Operation MC9S08QE128 MCU Series Reference Manual Rev 2 50 Freescale Semiconductor ...
Страница 138: ...Chapter 6 Parallel Input Output Control MC9S08QE128 MCU Series Reference Manual Rev 2 138 Freescale Semiconductor ...
Страница 144: ...Chapter 7 Keyboard Interrupt S08KBIV2 MC9S08QE128 MCU Series Reference Manual Rev 2 144 Freescale Semiconductor ...
Страница 166: ...Chapter 8 Central Processor Unit S08CPUV4 MC9S08QE128 MCU Series Reference Manual Rev 2 166 Freescale Semiconductor ...
Страница 174: ...MC9S08QE128 MCU Series Reference Manual Rev 2 174 Freescale Semiconductor Analog Comparator S08ACMPV3 ...
Страница 202: ...12 bit Analog to Digital Converter S08ADCV1 MC9S08QE128 MCU Series Reference Manual Rev 2 202 Freescale Semiconductor ...
Страница 282: ...Serial Peripheral Interface S08SPIV3 MC9S08QE128 MCU Series Reference Manual Rev 2 282 Freescale Semiconductor ...
Страница 306: ...Timer PWM Module S08TPMV3 MC9S08QE128 MCU Series Reference Manual Rev 2 306 Freescale Semiconductor ...
Страница 320: ...Development Support MC9S08QE128 MCU Series Reference Manual Rev 2 320 Freescale Semiconductor ...