NEC 78K0R/KE3 User Manual page 842

16-bit single-chip microcontrollers
Table of Contents

Advertisement

Function
Details of
Function
Simplified
Address field
2
I
C (IIC10,
transmission
IIC20)
Data reception
communi-
cation
Calculating
transfer rate
Serial
IIC0: IIC shift
interface
register 0
IIC0
PER0:
Peripheral
enable register 0
IICC0: IIC
control register 0
IICF0: IIC flag
register 0
IICX0: IIC
function
expansion
register 0
Setting transfer
clock
When STCEN =
0
842
APPENDIX B LIST OF CAUTIONS
After setting the PER0 register to 1, be sure to set the SPS0 register after 4 or more
clocks have elapsed.
ACK is not output when the last data is received (NACK). Communication is then
completed by setting "1" to the ST02 bit to stop operation and generating a stop
condition.
Setting SDR02[15:9] = 0000000B is prohibited. Setting SDR02[15:9] = 0000001B or
more.
Do not write data to IIC0 during data transfer.
Write or read IIC0 only during the wait period. Accessing IIC0 in a communication
state other than during the wait period is prohibited. When the device serves as the
master, however, IIC0 can be written only once after the communication trigger bit
(STT0) is set to 1.
When setting serial interface IIC0, be sure to set IIC0EN to 1 first. If IIC0EN = 0,
writing to a control register of serial interface IIC0 is ignored, and, even if the register
is read, only the default value is read (except for port mode register 6 (PM6) and port
register 6 (P6)).
Be sure to clear bits 1 and 6 of PER0 register to 0.
The start condition is detected immediately after I
while the SCL0 line is at high level and the SDA0 line is at low level. Immediately
2
after enabling I
C to operate (IICE0 = 1), set LREL0 (1) by using a 1-bit memory
manipulation instruction.
When bit 3 (TRC0) of IIC status register 0 (IICS0) is set to 1, WREL0 is set to 1
during the ninth clock and wait is canceled, after which TRC0 is cleared and the
SDA0 line is set to high impedance.
Write to STCEN only when the operation is stopped (IICE0 = 0).
As the bus release status (IICBSY = 0) is recognized regardless of the actual bus
status when STCEN = 1, when generating the first start condition (STT0 = 1), it is
necessary to verify that no third party communications are in progress in order to
prevent such communications from being destroyed.
Write to IICRSV only when the operation is stopped (IICE0 = 0).
Determine the transfer clock frequency of I
CL00 before enabling the operation (by setting bit 7 (IICE0) of IIC control register 0
(IICC0) to 1). To change the transfer clock frequency, clear IICE0 once to 0.
Determine the transfer clock frequency of I
CL00 before enabling the operation (by setting bit 7 (IICE0) of IIC control register 0
(IICC0) to 1). To change the transfer clock frequency, clear IICE0 once to 0.
2
IImmediately after I
C operation is enabled (IICE0 = 1), the bus communication status
(IICBSY (bit 6 of IICF0) =1) is recognized regardless of the actual bus status. When
changing from a mode in which no stop condition has been detected to a master
device communication mode, first generate a stop condition to release the bus, then
perform master device communication.
When using multiple masters, it is not possible to perform master device
communication when the bus has not been released (when a stop condition has not
been detected).
Use the following sequence for generating a stop condition.Use the following
sequence for generating a stop condition.
<1> Set IIC clock select register 0 (IICCL0).
<2> Set bit 7 (IICE0) of IIC control register 0 (IICC0) to 1.
<3> Set bit 0 (SPT0) of IICC0 to 1.
User's Manual U17854EJ9V0UD
Cautions
2
C is enabled to operate (IICE0 = 1)
2
C by using CLX0, SMC0, CL01, and
2
C by using CLX0, SMC0, CL01, and
(18/33)
Page
p.453
p.462
p.464
p.476
p.476
p.479
p.479
p.480
p.483
p.487
p.487
p.487
p.489
p.495
p.509

Advertisement

Table of Contents
loading

Table of Contents